avalonstrel / GatedConvolution_pytorch

A modified reimplemented in pytorch of inpainting model in Free-Form Image Inpainting with Gated Convolution [http://jiahuiyu.com/deepfill2/]
Other
434 stars 77 forks source link

when i run the python3 test_images.py config/test_places2_sagan.yml #17

Closed Lvhhhh closed 5 years ago

Lvhhhh commented 5 years ago

INFO:main:Initialize the dataset... INFO:main:Finish the dataset initialization. INFO:main:Define the Network Structure and Losses INFO:main:Loading pretrained models from latest_ckpt.pth.tar ... INFO:main:Finish Define the Network Structure and Losses INFO:main:Start Validation Traceback (most recent call last): File "test_images.py", line 244, in main() File "test_images.py", line 241, in main validate(nets, losses, opts, val_loader,0 , config.NETWORK_TYPE,devices=(cuda0,cuda1)) File "test_images.py", line 118, in validate pred_pos_neg = netD(pos_neg_imgs) File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, kwargs) File "/code/GatedConvolution_pytorch-master/models/sa_gan.py", line 216, in forward x = self.discriminator_net(input) File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, *kwargs) File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/container.py", line 92, in forward input = module(input) File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(input, kwargs) File "/code/GatedConvolution_pytorch-master/models/networks.py", line 150, in forward x = self.conv2d(input) File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, **kwargs) File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/conv.py", line 320, in forward self.padding, self.dilation, self.groups) RuntimeError: cuDNN error: CUDNN_STATUS_BAD_PARAM

anikethjr commented 5 years ago

Hey, I encountered the same issue. Were you able to solve it?

Thanks!

AlanStark commented 5 years ago

Hi @Lvhhhh

Have you solved this issue? Is it some problem with PyTorch version?

Thank you!

DongHwanJang commented 5 years ago

same problem here...

I think this link might be helpful https://discuss.pytorch.org/t/adding-cuda-gives-error-cudnn-status-bad-param/12745

Below result is derived by debugging input&self.conv2d from networks.py line 150

Conv2d(256, 256, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1)) torch.Size([2, 256, 1, 1])

The input size is too small for (4,4) kernel.

Wanna know why others didn't experience this error before.

I just commented line 211 in sa_gan.py and it worked. But not sure whether this is proper way to do or not.

SNConvWithActivation(8cnum, 8cnum, 4, 2, padding=get_pad(4, 5, 2)),

AlanStark commented 5 years ago

Hi @DongHwanJang,

I realized this issue too. I try to modify the padding parameter to fit the kernel size but still cannot fix it.