twtygqyy / pytorch-SRResNet

pytorch implementation for Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network arXiv:1609.04802
MIT License
477 stars 131 forks source link

Training Error #2

Closed yuanshuai220 closed 7 years ago

yuanshuai220 commented 7 years ago

When I run the python main.py --cuda --batchSize 4, I got this error.

Namespace(batchSize=4, clip=0.1, cuda=True, lr=0.0001, momentum=0.9, nEpochs=500, pretrained='', resume='', start_epoch=1, step=500, threads=1, weight_decay=0)
('Random Seed: ', 4270)
===> Loading datasets
===> Building model
===> Setting GPU
===> Setting Optimizer
===> Training
epoch = 1 lr = 0.0001
Traceback (most recent call last):
  File "main.py", line 130, in <module>
    main()
  File "main.py", line 82, in main
    train(training_data_loader, optimizer, model, criterion, epoch)
  File "main.py", line 108, in train
    loss = criterion(model(input), target)
  File "/home/shuai/.local/lib/python2.7/site-packages/torch/nn/modules/module.py", line 206, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/shuai/SRResNet/srresnet.py", line 65, in forward
    out = self.relu(self.conv_input(x))
  File "/home/shuai/.local/lib/python2.7/site-packages/torch/nn/modules/module.py", line 206, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/shuai/.local/lib/python2.7/site-packages/torch/nn/modules/conv.py", line 237, in forward
    self.padding, self.dilation, self.groups)
  File "/home/shuai/.local/lib/python2.7/site-packages/torch/nn/functional.py", line 40, in conv2d
    return f(input, weight, bias)
RuntimeError: CUDNN_STATUS_BAD_PARAM

I generated the trianing data with generate_train.m from VDSR.

twtygqyy commented 7 years ago

@yuanshuai220 SRResNet takes 3-channel patches as input, while VDSR takes 1-channel patches. Please modify the matlab code from VDSR into 3-channel version.

twtygqyy commented 7 years ago

@yuanshuai220 I've uploaded the code for training data generation. Please find them here: https://github.com/twtygqyy/pytorch-SRResNet/tree/master/data

yuanshuai220 commented 7 years ago

@twtygqyy Thank you very much!