wkentaro / pytorch-fcn

PyTorch Implementation of Fully Convolutional Networks. (Training code to reproduce the original result is available.)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: expected np.ndarray (got numpy.ndarray)

Iamyourbaba opened this issue · comments

Thank you for you effort.However, when I first run the train_fcn32s.py, some problems happen.
D:\project\fcn\pytorch-fcn-master\pytorch-fcn-master\examples\voc>python train_fcn32s.py -g 0
Traceback (most recent call last):
File "train_fcn32s.py", line 152, in
main()
File "train_fcn32s.py", line 108, in main
model = torchfcn.models.FCN32s(n_class=21)
File "D:\anaconda\lib\site-packages\torchfcn\models\fcn32s.py", line 96, in init
self._initialize_weights()
File "D:\anaconda\lib\site-packages\torchfcn\models\fcn32s.py", line 107, in _initialize_weights
m.in_channels, m.out_channels, m.kernel_size[0])
File "D:\anaconda\lib\site-packages\torchfcn\models\fcn32s.py", line 23, in get_upsampling_weight
return torch.from_numpy(weight).float()
TypeError: expected np.ndarray (got numpy.ndarray)

I have no idea to slove, thanks a lot for your help

@Iamyourbaba Hi, I run into the same error, and didn't find any solution, you should have solved it now, can you help me ? thanks

It's also happening to me on numpy 1.17.4, my own solution is to downgrade to 1.16.4