Pytorch——谜之bug汇总

运行别人的代码的时候报错:RuntimeError: CUDA out of memory. Tried to allocate 512.00 MiB (GPU 0; 11.90 GiB total capacity; 11.15 GiB already allocated; 46.94 MiB free; 241.57 MiB cached) 

但是nvidia-smi查看显卡,显存充足   

Pytorch——谜之bug汇总                            

解决:batch改小一点,本来代码里是8,我觉得够小了。。改成4就跑起来了。。

-------------------------------------------------------------------------------------------------------------------------------------------------