一、RuntimeError: CUDA out of memory. Tried to allocate 14.00 MiB (GPU 0; 10.76 GiB total capacity; 9.69 GiB already allocated; 15.56 MiB free; 9.91 GiB reserved in total by PyTorch)缓存
- 应该有三个缘由
- GPU还有其余进程占用显存,致使本进程没法分配到足够的显存
- 缓存过多,使用
torch.cuda.empty_cache()
清理缓存 - 卡不行,换块显存更大的卡吧
- 除此以外,注意pytorch在test时,必定要加上
下面的颇有效:code
with torch.no_grad(): # test process
不然会使显存加倍致使OOM错误进程
二、远程主机间复制文件及文件夹ip
复制文件: ci
* 命令格式: rem
scp local_file remote_username@remote_ip:remote_folder get
或者 it
scp local_file remote_username@remote_ip:remote_file class
或者 test
scp local_file remote_ip:remote_folder
或者
scp local_file remote_ip:remote_file
复制目录:
* 命令格式:
scp -r local_folder remote_username@remote_ip:remote_folder
或者
scp -r local_folder remote_ip:remote_folder