RuntimeError: CUDA out of memory. Tried to allocate 32.00 MiB (GPU
RuntimeError: CUDA out of memory. Tried to allocate 32.00 MiB (GPU)1. 问题描述2. 解决办法1. 问题描述Pytorch,GPU显存明明够用,为什么还报错呢?发现此时减小batch_size 同样是没用的。根本原因是代码指定的GPU与实际使用的GPU不一致。你以为代码在1上跑,实际上是在已经有代码运行的其他gpu跑,因此显示显存不足。2. 解决办法让自己指定的gpu与实际使用的对应一致即可。比如,现在0,2,3号GPU已经在










