tengshaofeng / ResidualAttentionNetwork-pytorch

a pytorch code about Residual Attention Network. This code is based on two projects from
667 stars 165 forks source link

TypeError #3

Closed zhaobingbingbing closed 6 years ago

zhaobingbingbing commented 6 years ago

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:

tengshaofeng commented 6 years ago

@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.