When I use 6G GPU to run "sh train_PCB.sh" code and get the following error:
(some one suggested that this may caused by batch_size set too big, is this the case and how to resolve this?) Thanks.
$ sh train_PCB.sh
Market dataset loaded
subset | # ids | # images
train | 751 | 12936
query | 750 | 3368
gallery | 751 | 15913
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:47: UserWarning: nn.init.kaiming_normal is now deprecated in favor of nn.init.kaiming_normal_.
init.kaiming_normal(self.local_conv.weight, mode= 'fan_out')
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:50: UserWarning: nn.init.constant is now deprecated in favor of nn.init.constant_.
init.constant(self.feat_bn2d.weight,1) #initialize BN, may not be used
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:51: UserWarning: nn.init.constant is now deprecated in favor of nn.init.constant_.
init.constant(self.feat_bn2d.bias,0) # iniitialize BN, may not be used
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:55: UserWarning: nn.init.normal is now deprecated in favor of nn.init.normal_.
init.normal(self.instance0.weight, std=0.001)
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:56: UserWarning: nn.init.constant is now deprecated in favor of nn.init.constant_.
init.constant(self.instance0.bias, 0)
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:60: UserWarning: nn.init.normal is now deprecated in favor of nn.init.normal_.
init.normal(self.instance1.weight, std=0.001)
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:61: UserWarning: nn.init.constant is now deprecated in favor of nn.init.constant_.
init.constant(self.instance1.bias, 0)
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:65: UserWarning: nn.init.normal is now deprecated in favor of nn.init.normal_.
init.normal(self.instance2.weight, std=0.001)
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:66: UserWarning: nn.init.constant is now deprecated in favor of nn.init.constant_.
init.constant(self.instance2.bias, 0)
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:70: UserWarning: nn.init.normal is now deprecated in favor of nn.init.normal_.
init.normal(self.instance3.weight, std=0.001)
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:71: UserWarning: nn.init.constant is now deprecated in favor of nn.init.constant_.
init.constant(self.instance3.bias, 0)
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:75: UserWarning: nn.init.normal is now deprecated in favor of nn.init.normal_.
init.normal(self.instance4.weight, std=0.001)
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:76: UserWarning: nn.init.constant is now deprecated in favor of nn.init.constant_.
init.constant(self.instance4.bias, 0)
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:80: UserWarning: nn.init.normal is now deprecated in favor of nn.init.normal_.
init.normal(self.instance5.weight, std=0.001)
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:81: UserWarning: nn.init.constant is now deprecated in favor of nn.init.constant_.
init.constant(self.instance5.bias, 0)
Traceback (most recent call last):
File "PCB.py", line 202, in
main(parser.parse_args())
File "PCB.py", line 145, in main
trainer.train(epoch, train_loader, optimizer)
File "/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/trainers_partloss.py", line 33, in train
loss0, loss1, loss2, loss3, loss4, loss5, prec1 = self._forward(inputs, targets)
File "/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/trainers_partloss.py", line 74, in _forward
outputs = self.model(*inputs)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/parallel/data_parallel.py", line 121, in forward
return self.module(*inputs[0], **kwargs[0])
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py", line 121, in forward
x = module(x)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/container.py", line 91, in forward
input = module(input)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/torchvision/models/resnet.py", line 91, in forward
identity = self.downsample(x)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/container.py", line 91, in forward
input = module(input)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/batchnorm.py", line 66, in forward
exponential_average_factor, self.eps)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/functional.py", line 1254, in batch_norm
training, momentum, eps, torch.backends.cudnn.enabled
RuntimeError: CUDA error: out of memory