pytorch-fcn icon indicating copy to clipboard operation
pytorch-fcn copied to clipboard

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

Open Iamyourbaba opened this issue 5 years ago • 3 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 avatar Jun 19 '19 05:06 Iamyourbaba

@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

Biaocsu avatar Aug 09 '19 03:08 Biaocsu

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

luthfianto avatar Nov 24 '19 23:11 luthfianto

thanks a lot

---Original--- From: "Rizky Luthfianto"<[email protected]> Date: Mon, Nov 25, 2019 07:58 AM To: "wkentaro/pytorch-fcn"<[email protected]>; Cc: "Iamyourbaba"<[email protected]>;"Mention"<[email protected]>; Subject: Re: [wkentaro/pytorch-fcn] TypeError: expected np.ndarray (got numpy.ndarray) (#124)

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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Iamyourbaba avatar Nov 28 '19 06:11 Iamyourbaba