pytorch/examples

Input type and weight type should be the same

Open

#599 geöffnet am 1. Aug. 2019

Auf GitHub ansehen
 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Python (9.429 Forks)batch import
good first issuetriaged

Repository-Metriken

Stars
 (21.634 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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

Contributor Guide