Bartzi / see

Code for the AAAI 2018 publication "SEE: Towards Semi-Supervised End-to-End Scene Text Recognition"
GNU General Public License v3.0
573 stars 147 forks source link

fsns_demo.py reshape error #81

Open Averu-zz opened 4 years ago

Averu-zz commented 4 years ago

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 commented 4 years ago

How did you run the fsns_demo.py script?

Averu-zz commented 4 years ago

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 commented 4 years ago

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

Averu-zz commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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.