Hello,
I have defined a densenet architecture in PyTorch to use it on training data consisting of 15000 samples of 128x128 images. When I want to train a densenet network, I get this error-stack:
RuntimeError Traceback (most recent call last)
<ipython-input-40-6dace5fb9ac5> in <module>
118 labels = batch[1].float().to(device)
119
--> 120 preds = network(images) # Pass Batch
121 # preds_dev = network(images_dev)
122
C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\module.py in _call_impl(self, *input, **kwargs)
720 result = self._slow_forward(*input, **kwargs)
721 else:
--> 722 result = self.forward(*input, **kwargs)
723 for hook in itertools.chain(
724 _global_forward_hooks.values(),
<ipython-input-7-652ef2b441c1> in forward(self, x)
81
82 def forward(self, x):
---> 83 out = self.relu(self.lowconv(x))
84
85 out = self.denseblock1(out)
C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\module.py in _call_impl(self, *input, **kwargs)
720 result = self._slow_forward(*input, **kwargs)
721 else:
--> 722 result = self.forward(*input, **kwargs)
723 for hook in itertools.chain(
724 _global_forward_hooks.values(),
C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\conv.py in forward(self, input)
417
418 def forward(self, input: Tensor) -> Tensor:
--> 419 return self._conv_forward(input, self.weight)
420
421 class Conv3d(_ConvNd):
C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\conv.py in _conv_forward(self, input, weight)
413 weight, self.bias, self.stride,
414 _pair(0), self.dilation, self.groups)
--> 415 return F.conv2d(input, weight, self.bias, self.stride,
416 self.padding, self.dilation, self.groups)
417
RuntimeError: [enforce fail at ..\c10\core\CPUAllocator.cpp:72] data. DefaultCPUAllocator: not enough memory: you tried to allocate 536870912 bytes. Buy new RAM!
However, it does not make sense to me: 536870912 bytes = 512 Mb. The total RAM memory that I have is 64 Gb, and the task manager shows that only ~1 % of that memory is utilized. Would anybody know what is going on here and how I can tell PyTorch that there is enough memory?
Nevertheless, some of the tabs in Chrome are not being able to be sustained throwing a message “Not enough memory to open this page. Error code: Out of Memory” or “Can’t open this page. Error code: Crashpad_HandlerDiDNotRespond”, so essentially it agrees with PyTorch. But still numbers do not add up!