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

fsns_demo.py reshape error #81

Open
Averu-zz opened this issue Jul 25, 2019 · 6 comments
Open

fsns_demo.py reshape error #81

Averu-zz opened this issue Jul 25, 2019 · 6 comments

Comments

@Averu-zz
Copy link

Hello. I'm getting error when trying to run fsns_demo.py.

Traceback (most recent call last):
File "fsns_demo.py", line 153, in
predictions, crops, grids = network(image[xp.newaxis, ...])
File "/home/ml/Downloads/see/chainer/models/fsns.py", line 514, in call
images = F.reshape(images, (batch_size, num_channels, height, 4, -1))
File "/home/ml/env/lib/python3.5/site-packages/chainer/functions/array/reshape.py", line 98, in reshape
y, = Reshape(shape).apply((x,))
File "/home/ml/env/lib/python3.5/site-packages/chainer/function_node.py", line 230, in apply
self._check_data_type_forward(in_data)
File "/home/ml/env/lib/python3.5/site-packages/chainer/function_node.py", line 298, in _check_data_type_forward
self.check_type_forward(in_type)
File "/home/ml/env/lib/python3.5/site-packages/chainer/functions/array/reshape.py", line 40, in check_type_forward
type_check.prod(x_type.shape) % size_var == 0)
File "/home/ml/env/lib/python3.5/site-packages/chainer/utils/type_check.py", line 524, in expect
expr.expect()
File "/home/ml/env/lib/python3.5/site-packages/chainer/utils/type_check.py", line 482, in expect
'{0} {1} {2}'.format(left, self.inv, right))
chainer.utils.type_check.InvalidType:
Invalid operation is performed in: Reshape (Forward)

Expect: prod(in_types[0].shape) % known_size(=1800) == 0
Actual: 900 != 0

Any Ideas how to fix this? I have tried different shaped and sized pictures but no avail.

@Bartzi
Copy link
Owner

Bartzi commented Jul 25, 2019

How did you run the fsns_demo.py script?

@Averu-zz
Copy link
Author

with command
python fsns_demo.py /home/ml/Downloads/see/chainer/models model_35000.npz /home/ml/Downloads/see/chainer/models/vk.jpg /home/ml/Downloads/see/datasets/fsns/fsns_char_map.json

@Bartzi
Copy link
Owner

Bartzi commented Jul 25, 2019

could you show me this image? /home/ml/Downloads/see/chainer/models/vk.jpg

@Averu-zz
Copy link
Author

sure here is a link: https://imgur.com/a/sDiJdaL
I tried pictures of varying format and sizes. Getting the same error, but values of known size and actual change.

@Averu-zz
Copy link
Author

I did not copy all files fsns_model/model to see/chainer/models. Just model_35000.npz and log files. The fsns.py and train_fsns.py wher not copied. see/chainer/models already contained a fsns.py file and I dont think I'll need train_fsfs.py to test demo. Should i replace the fsns.py?

@Bartzi
Copy link
Owner

Bartzi commented Jul 25, 2019

I tried pictures of varying format and sizes

The FSNS Model is trained on pictures of size 600x150. Furthermore, the FSNS dataset consists of images that always show four independent views of a street sign. So the model won't work on an image like the one you provided.

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