see icon indicating copy to clipboard operation
see copied to clipboard

Ho do I make inference for textrec after training?

Open stasbel opened this issue 7 years ago • 7 comments

@Bartzi So I made my own dataset, do the training and then trying to make an inference for new image. How do I do that? It turns out that my log file lack of certain attributes if I trying to use text_recognition_demo.py:

Traceback (most recent call last): File "see/chainer/text_recognition_demo.py", line 150, in target_shape = Size._make(log_data['target_size']) KeyError: 'target_size'

stasbel avatar Apr 02 '18 17:04 stasbel

That's odd... the log file should be created after the first 100 iterations and contain the necessary data. Is your dataset large enough for the training to still be in epoch 0 at iteration 100? This could be the reason why this information is not logged.

Bartzi avatar Apr 03 '18 09:04 Bartzi

Hi, thx you for the response! I use exact same data set you provided at https://bartzi.de/research/see. Training stage goes fine and creates train log afterwards at specified dir, but, unlike log at provided dataset, it lacks certain attributes and I don't know why.

stasbel avatar Apr 03 '18 09:04 stasbel

Hmm, I did not provide a dataset for text recognition, as there is not enough space to host that data there. which dataset are you using? And did you check that you are still in epoch 0 after 100 iterations?

Bartzi avatar Apr 03 '18 11:04 Bartzi

I talk about text_recognition_model.zip at https://bartzi.de/research/see. No, after 100 iterations I already got 10 epochs, that's may be the problem. Gonna retrain it soon.

stasbel avatar Apr 05 '18 14:04 stasbel

Ok, you can change this line to: if stats_cpu['iteration'] == args.log_interval: and it should work.

Bartzi avatar Apr 06 '18 11:04 Bartzi

That helped me too - would you mind updating the repo or should I create a pull request?

FelixSchwarz avatar Jun 21 '18 17:06 FelixSchwarz

I'd be happy merging your PR =)

Bartzi avatar Jun 22 '18 13:06 Bartzi