pytorch/examples

Input type and weight type should be the same

Open

#599 建立於 2019年8月1日

在 GitHub 查看
 (2 留言) (0 反應) (0 負責人)Python (9,429 fork)batch import
good first issuetriaged

倉庫指標

Star
 (21,634 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

For the super resolve run, I get this error

$ python super_resolve.py --input_image dataset/BSDS300/images/test/16077.jpg --model model_epoch_30.pth --output_filename out.png
Namespace(cuda=False, input_image='dataset/BSDS300/images/test/16077.jpg', model='model_epoch_30.pth', output_filename='out.png')
Traceback (most recent call last):
  File "super_resolve.py", line 29, in <module>
    out = model(input)
  File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 491, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/mahmood/cactus/pt/pytorch/examples/super_resolution/model.py", line 20, in forward
    x = self.relu(self.conv1(x))
  File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 491, in __call__
    result = self.forward(*input, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/conv.py", line 339, in forward
    self.padding, self.dilation, self.groups)
RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same

Any idea?

P.S: Although readme file says model_epoch_500.pth, but with --nEpochs 30, I see model_epoch_30.pth

貢獻者指南