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 #3

Closed
zhaobingbingbing opened this issue May 13, 2018 · 1 comment
Closed

TypeError #3

zhaobingbingbing opened this issue May 13, 2018 · 1 comment

Comments

@zhaobingbingbing
Copy link

When I run this code in python3.6
I met an error
'File "/home/user/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 33, in init
out_channels, in_channels // groups, *kernel_size))
TypeError: torch.FloatTensor constructor received an invalid combination of arguments - got (float, int, int, int), but expected one of:

  • no arguments
  • (int ...)
    didn't match because some of the arguments have invalid types: (float, int, int, int)
  • (torch.FloatTensor viewed_tensor)
  • (torch.Size size)
  • (torch.FloatStorage data)
  • (Sequence data)
    '
    Do you know how to fix it
    Thank you
@tengshaofeng
Copy link
Owner

tengshaofeng commented May 15, 2018

@zhaobingbingbing , sorry for reply so late.
ok, it means that float is not supported, you can cast it to int before. In python2 int/int=int, but in python3 int/int=float , so that is the reason.
image
you can add int() for casting in ResidualBlock.

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