Cuda runtime error (2) : out of memory
I would like to know how can I solve my problem. What is the source of problem? My Code:
mderakhshani
The problem is exactly what the error says, you ran out of memory on the GPU. You can try reducing the batch size or image sizes.
apaszke
sarthak1996
To complement apaszke’s answer, in case you are using Jupyter and you ‘run’ multiple times the cell which creates the network, put always a delete net on that cell, otherwise you might be creating multiple neural networks which will cause similar problems. If not, just try to find the maximum batch size which works for your hardware.
Ismail_Elezi
afrozalm
afrozalm
I face the same problem with you and I find the problem results from the upsampling layer. When I use nvidia-smi to monitor my GPU memory usage, I find that during some time, the memory requirement for transpose2d for upsampling will be doubled and it tells me out of memory… Maybe consider to reduce the batch size.
PeterXiaoGuo