handwriting-ocr
handwriting-ocr copied to clipboard
Word-CTC classifier not training
Anytime I try to train the CTC model it comes back with a value error
ValueError: Cannot evaluate tensor using
eval(): No default session is registered.
Tried setting a default session with this,
with sess.as_default():
tf.global_variables_initializer().run()
doesn't work still. Would appreciate a guide through this, Thank you
Hi,
I am sorry. I forget about this error. Basically, you have to replace all occurrences of .eval()
. For example this:
accTrain = accuracy.eval(fd)
Must be changed into this:
accTrain = accuracy.eval(fd, session=sess)
That is same as sess.run(accuracy, feed_dict=fd)
Feel free to send pull request with the changes to fix this bug.
Thanks for the quick response. I would definitely make a pull request in order to commit changes, had to current some bugs in mlhelpers.py also.
Currently having problems with accuracy under training. Apparently It is not defined
accTest = accuracy.eval(fd_test, session = sess)
I see. I haven't implemented it yet, there were some issues with matching the correct output lengths.
You can use label_err_rate
instead of accuracy
it is kinda similar, but less is better.
Currently got it to work, I would make a pull request once I am done editing. What least parameters would you recommend training the IAM dataset on considering the usage of Tesla K80 GPU on colab
Great, I would be really thankful for that. I am not really sure about the parameters. Just experiment and you will see.
Yeah, I finally trained the model with the default parameters, It was faster than I expected. Can you have a look at the characters script when you're less busy, can't seem to import it into OCR.ipynb because it's finding it hard to locate gap-clas/CNN-CG model and gap-clas/RNN/Bi-RNN-new
Sorry to bother you, I just fixed it. Would make updated changes available soon enough.
And finally, what alternative function can i use to recognise using CTC model. The current function does not seem to predict correctly?
tosi-n, were you able to train CTC model? if so please see my 145th ticket