Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: new(): argument 'size' must be tuple of ints, but found element of type float at pos 3 #13

Open
lzzlxxlsz opened this issue May 21, 2019 · 6 comments

Comments

@lzzlxxlsz
Copy link

Hello,when I run the code,as your request, run test.py --dataroot dataset/var --netG model/netG_streetview.pth --batchSize 100.But it turn the errors :
File "C:/Users/LZZ/Downloads/context_encoder_pytorch-master/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

@zhangbaijin
Copy link

Did you solved the problem? i have the same problem..

@lzzlxxlsz
Copy link
Author

It should be the data type error,you can convert it

@zhangbaijin
Copy link

thanks,but i have no ieda,the problem is "real_center = torch.FloatTensor(1, 3, opt.imageSize/2, intopt.imageSize/2)",and i changed it to" real_center = torch.FloatTensor(1, 3, int(opt.imageSize/2), int(opt.imageSize/2))",and another problem occured.

@lzzlxxlsz
Copy link
Author

sorry,you can ask someone eles for help,I am not clear for it

@zhangbaijin
Copy link

ok,thanks for your time!

@lzzlxxlsz
Copy link
Author

my pleasure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants