Closed xulingzhi951118 closed 5 years ago
it seems that the layout of the aray is not correct and the width is either not dividable by 4, or there happened something else with the data. It also seems that you changed the code a little, as the location of the error is off by two lines, comapred to the code in the repository... any changes you made that might break things?
Thank you very much for your reply. It is because a stupid mistake and I have fixed it.
Hello, I have a problem when I am running fsns_demo, here is what I got from the terminal: python3 fsns_demo.py /media/xulingzhi/DATA/see-master/chainer/model/ model_35000.npz /media/xulingzhi/DATA/see-master/chainer/test_image/1.jpg ../datasets/fsns/fsns_char_map.json
Traceback (most recent call last): File "fsns_demo.py", line 153, in
predictions, crops, grids = network(image[xp.newaxis, ...])
File "/media/xulingzhi/DATA/see-master/chainer/model/fsns.py", line 516, in call
images = F.reshape(images, (batch_size, num_channels, height, 4, -1))
File "/usr/local/lib/python3.5/dist-packages/chainer/functions/array/reshape.py", line 95, in reshape
y, = Reshape(shape).apply((x,))
File "/usr/local/lib/python3.5/dist-packages/chainer/function_node.py", line 245, in apply
self._check_data_type_forward(in_data)
File "/usr/local/lib/python3.5/dist-packages/chainer/function_node.py", line 330, in _check_data_type_forward
self.check_type_forward(in_type)
File "/usr/local/lib/python3.5/dist-packages/chainer/functions/array/reshape.py", line 37, in check_type_forward
type_check.prod(x_type.shape) % size_var == 0)
File "/usr/local/lib/python3.5/dist-packages/chainer/utils/type_check.py", line 546, in expect
expr.expect()
File "/usr/local/lib/python3.5/dist-packages/chainer/utils/type_check.py", line 483, in expect
'{0} {1} {2}'.format(left, self.inv, right))
chainer.utils.type_check.InvalidType:
Invalid operation is performed in: Reshape (Forward)
Expect: prod(x.shape) % known_size(=7200) == 0 Actual: 3600 != 0
Maybe it's still because the input image size, but I have set the input size to 600*150, but it seems that prod(x.shape)%known_size(=700) = 3600.
How can I solve this problm? Thank you!