1. RuntimeError: cuDNN error: CUDNN_STATUS_INTERNAL_ERROR
有博主說清理緩存 rm -rf ~/.nv 但我這裏不work。
還有博客說可能是內存不夠,然後去試了多gpu,發現可。
2. RuntimeError: CUDA out of memory. Tried to allocate 1.75 MiB (GPU 0; 11.17 GiB total capacity; 3.34 GiB already allocated; 768.00 KiB free; 35.32 MiB cached)
不要在循環訓練中累計歷史紀錄
total loss +=loss
改爲 total loss += float(loss)
我這裏可work。