context_encoder_pytorch icon indicating copy to clipboard operation
context_encoder_pytorch copied to clipboard

argument 'size' must be tuple of ints, but found element of type float at pos 3

Open caruofc opened this issue 5 years ago • 3 comments

This is what I am getting when I run test.py

Traceback (most recent call last): File "test.py", line 64, in real_center = torch.FloatTensor(opt.batchSize, 3, opt.imageSize/2, opt.imageSize/2) TypeError: new(): argument 'size' must be tuple of ints, but found element of type float at pos 3

any ideas?

caruofc avatar Jun 06 '20 18:06 caruofc

you may try real_center = torch.FloatTensor(opt.batchSize, 3, int(opt.imageSize/2), int(opt.imageSize/2))

nanfengyinliu avatar Jun 09 '20 11:06 nanfengyinliu

你解决了吗,怎么解决的

01SHENyankun avatar Sep 22 '21 00:09 01SHENyankun

你解决了吗,怎么解决的

find all the "imageSize/" replace by "imageSize//". This is the difference between python3 and python2 version, py3 will become decimal

R1ckLou avatar Apr 13 '22 11:04 R1ckLou