Error when training

whene i try to train my neural network i meet this error:
torch/nn/modules/", line 477, in call
result = self.forward(*input, **kwargs)
File “/home/imene/anaconda3/envs/pose/lib/python3.6/site-packages/torch/nn/modules/”, line 301, in forward
self.padding, self.dilation, self.groups)
RuntimeError: CUDA error: out of memory
I tried to put batch size to 1 but that does not work,
I have an i7 RAM = 12G, GPU = [GeForce GTX 750 Ti] (rev a2) 2G
can any one give me solution because i am blocked since tow weeks

2GB might not be enough for your training to run.
You could try to trade compute for memory using torch.utils.checkpoint or just push some layers to the GPU and keep others on the CPU.

tanks for your replay, have you any example to how to do this because i am novice in using pytorch

Have a look at this notebook. Note that it’s quite old by now and you wouldn’t need to use Variables anymore.
However, it might still give you a good idea about the usage of checkpointing.

tanks i will read it