I was testing a pytorch code today and it was showing insufficient memory, but the web framework is obviously very simple and runs on the CPU with no problems, but the GPU keeps prompting out of memory.
In the Internet to find a lot of methods do not work, and finally I think that maybe it is the pytorch version of the problem, it turns out that my pytorch version is 0.4.1, so I uninstalled this version, and then installed pytorch1.1.0, the program can be magically run, and will not have the OOM prompt. Although the exact reason is not yet know why, here is the first mark, the specific process is as follows:
Uninstall the old version of pytorch:
conda uninstall pytorch
Installed pytorch 1.1.0, as per the official website, and my CUDA version is 9.0:
conda install pytorch torchvision cudatoolkit=9.0 -c pytorch
It's done!
Above this Pytorch GPU video memory is sufficient but shows out of memory solution is all that I share with you, I hope to give you a reference, and I hope you support me more.