context_encoder_pytorch icon indicating copy to clipboard operation
context_encoder_pytorch copied to clipboard

torch.FloatTensor constructor received an invalid combination of arguments

Open micklexqg opened this issue 8 years ago • 2 comments

I try to run test_one.py but failed at real_center = torch.FloatTensor(1, 3, opt.imageSize/2, opt.imageSize/2) with the error: ypeError: torch.FloatTensor constructor received an invalid combination of arguments - got (int, int, float, float), but expected one of:

  • no arguments
  • (int ...) didn't match because some of the arguments have invalid types: (!int!, !int!, !float!, !float!)
  • (torch.FloatTensor viewed_tensor)
  • (torch.Size size)
  • (torch.FloatStorage data)
  • (Sequence data) is there any thing wrong?

micklexqg avatar Dec 13 '17 06:12 micklexqg

try: real_center = torch.FloatTensor(1, 3, int(opt.imageSize/2), int(opt.imageSize/2)) instead

BoyuanJiang avatar Dec 13 '17 15:12 BoyuanJiang

@BoyuanJiang , yes, thank you , I have fixed it.

micklexqg avatar Dec 14 '17 07:12 micklexqg