運行別人的代碼的時候報錯: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查看顯卡,顯存充足
解決:batch改小一點,本來代碼裏是8,我覺得夠小了。。改成4就跑起來了。。
-------------------------------------------------------------------------------------------------------------------------------------------------