Hi,I got the error
Files already downloaded and verified
start…
Traceback (most recent call last):
File “test.py”, line 218, in
main()
File “test.py”, line 83, in main
fake = G(noise)
File “/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py”, line 489, in call
result = self.forward(*input, **kwargs)
File “/home/lilipan/ldagan/model.py”, line 81, in forward
h = self.block2(h)
File “/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py”, line 489, in call
result = self.forward(*input, **kwargs)
File “/home/lilipan/ldagan/model.py”, line 54, in forward
return self.residual(input) + self.shortcut(input)
File “/home/lilipan/ldagan/model.py”, line 38, in residual
h = self.b1(h)
File “/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py”, line 489, in call
result = self.forward(*input, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/torch/nn/modules/batchnorm.py”, line 76, in forward
exponential_average_factor, self.eps)
File “/usr/local/lib/python2.7/dist-packages/torch/nn/functional.py”, line 1623, in batch_norm
training, momentum, eps, torch.backends.cudnn.enabled
RuntimeError: cuDNN error: CUDNN_STATUS_EXECUTION_FAILED
class genBlock(nn.Module):
def init(self, in_channels, out_channels,
activation=F.relu, hidden_channels=None, ksize=3, pad=1, upsample=False, n_classes=0):
super(genBlock, self).init()
self.activation = activation
self.upsample = upsample
self.learnable_sc = in_channels != out_channels or upsample
hidden_channels = out_channels if hidden_channels is None else hidden_channels
self.n_classes = n_classes
self.c1 = nn.Conv2d(in_channels, hidden_channels, kernel_size=ksize, padding=pad)
#nn.init.xavier_uniform_(self.c1.weight.data, math.sqrt(2))
self.c2 = nn.Conv2d(hidden_channels, out_channels, kernel_size=ksize, padding=pad)
#nn.init.xavier_uniform_(self.c2.weight.data, math.sqrt(2))
self.b1 = nn.BatchNorm2d(in_channels)
self.b2 = nn.BatchNorm2d(hidden_channels)
if self.learnable_sc:
self.c_sc = nn.Conv2d(in_channels, out_channels, kernel_size=ksize, padding=pad)
It shows that there is some problem in self.b1. I deleted self.b1and it worked.
Graphic card: 2080TI pytorch 1.0.0
Interestingly, it also occurs at self.b1, when i change to pytorch 0.4.1. But it shows:
RuntimeError: cuDNN error: CUDNN_STATUS_SUCCESS
And I also ran the same code in another machine, and it worked well.
Graphic card: 1080TI pytorch 0.4.1