CUDA out of memory问题(已解决)深度学习

#Cuda out of memory 问题解决

  1. RuntimeError:CUDA out of memory.Tried to allocate 256.00 MiB (GPU0;23.70GiBtotal capacity;844.99 MiB already allocated;186.44 MiB free:868.00 MiBreserved in total by PyTorch)If reserved memory is >allocated memory trysettingmax split size mb to avoid fragmentation. See documentation for MemoryManagement and PYTORCH CUDA ALLOC CONF
    CUDA out of memory问题(已解决)深度学习_第1张图片

错误原因1:有占内存进程在运行

解决方案:
Nvidia-smi查看占内存的进程号
kill -KILL 进程号

错误原因2:batch size太大,尝试调小

你可能感兴趣的:(深度学习,pytorch,人工智能)