da03 / Attention-OCR

Visual Attention based OCR
MIT License
1.12k stars 363 forks source link

train fail #18

Closed Yang507 closed 7 years ago

Yang507 commented 7 years ago

hello, I tried to train your data with your code, I use the tensorflow as the backend and I meet a problem. how can i solve it? I’d like to receive your answer, thanks!

File "~/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 496, in __iter__
 raise TypeError("'Tensor' object is not iterable.")
TypeError: 'Tensor' object is not iterable.
da03 commented 7 years ago

Oh that should be an issue with the new keras version. Try downgrade the keras version to 1.0.1.

Yang507 commented 7 years ago

sorry, i've tried some methods but i didn't solve the keras' downgrade problem, could you give me some suggestions?my keras' version is 1.1.1, thank you!

da03 commented 7 years ago

Okay I'll look into this problem and get back after fixing it. A temporary solution is to comment those lines, which means opting out the batch normalization layers. That might lead to slower convergence or poorer optimum.

Yang507 commented 7 years ago

I used the keras version 1.0.4( https://testpypi.python.org/pypi/Keras) can run, the problem had been solved.

da03 commented 7 years ago

I just updated a version which supports the latest tensorflow and keras. However, it might not be able to run on the older version tensorflow and keras. The original implemenation is in branch old.