githubharald / SimpleHTR

Handwritten Text Recognition (HTR) system implemented with TensorFlow.
https://towardsdatascience.com/2326a3487cd5
MIT License
1.99k stars 893 forks source link

Deployment model as web app #147

Closed miracseref closed 2 years ago

miracseref commented 2 years ago

Hello Mr. Harald,

First of all, I want to thank you for sharing your work. I have trouble with the saved model. Since it was trained with TensorFlow 1, the format is slightly different from TensorFlow 2 models. I'm building a web app with Flask for deploying this model but I couldn't figure out how to implement the model. Can you help me? Thanks

githubharald commented 2 years ago

It's trained with TF2, but uses the TF1 operations. So it definitely runs with TF2 (see requirements.txt, there I used tensorflow==2.4.0).

miracseref commented 2 years ago

Hello, Since it uses TF1 operations I'm not able to save the model as a .h5 or .pkl file by doing model.save(). And I don't know how to load TF1 models, so I wonder if you could help to load this model in my Flask web app? Thanks

githubharald commented 2 years ago

You can directly load the checkpoint file (as its done here), is there a reason why you want to export to h5?

miracseref commented 2 years ago

I see, thank you for taking the time. I appreciate it. The only reason I want to export as an .h5 is that it's easy to manipulate.