quantized.pytorch icon indicating copy to clipboard operation
quantized.pytorch copied to clipboard

input

Open wm901115nwpu opened this issue 6 years ago • 0 comments

if my input is torch.autograd.Variable, how to correct the code. I met the error: File "example/mpii.py", line 352, in main(parser.parse_args()) File "example/mpii.py", line 107, in main train_loss, train_acc = train(train_loader, model, criterion, optimizer, args.debug, args.flip) File "example/mpii.py", line 153, in train output = model(input_var) File "/home/wangmeng/anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 224, in call result = self.forward(*input, **kwargs) File "/home/wangmeng/anaconda2/lib/python2.7/site-packages/torch/nn/parallel/data_parallel.py", line 58, in forward return self.module(*inputs[0], **kwargs[0]) File "/home/wangmeng/anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 224, in call result = self.forward(*input, **kwargs) File "/home/wangmeng/pytorch-pose-quantized/pose/models/hourglass_quantized.py", line 172, in forward x = self.conv1(x) File "/home/wangmeng/anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 224, in call result = self.forward(*input, **kwargs) File "/home/wangmeng/pytorch-pose-quantized/pose/models/modules/quantize.py", line 188, in forward qinput = self.quantize_input(input) File "/home/wangmeng/anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 224, in call result = self.forward(*input, **kwargs) File "/home/wangmeng/pytorch-pose-quantized/pose/models/modules/quantize.py", line 165, in forward min_value * (1 - self.momentum)) TypeError: add_ received an invalid combination of arguments - got (Variable), but expected one of:

  • (float value) didn't match because some of the arguments have invalid types: (Variable)
  • (torch.cuda.FloatTensor other) didn't match because some of the arguments have invalid types: (Variable)
  • (torch.cuda.sparse.FloatTensor other) didn't match because some of the arguments have invalid types: (Variable)
  • (float value, torch.cuda.FloatTensor other)
  • (float value, torch.cuda.sparse.FloatTensor other)

wm901115nwpu avatar Jan 07 '19 09:01 wm901115nwpu