-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regarding Deployment on Flask #37
Comments
Any specific error messages? |
For those of you who are trying to serve a ktrain model with Flask: It looks like this is an issue with Flask/TensorFlow, not ktrain. The latest version of Flask causes a Session graph is empty error when trying to serve a TensorFlow model on TensorFlow 1.14. See this Keras issue for more information. It apparently works in TensorFlow 2.0. However, when using a pre-v0.8 version of ktrain on TensorFlow 2, ktrain still runs in TensorFlow 1.x mode in order to support both TF 1.14 and 2.0 right now. This is why you see this error on both TF 1.14 and TF 2.0 when using ktrain. This will no longer be a problem in ktrain v0.8 (which has not yet been released) because this version of ktrain will only support TensorFlow 2 (not TensorFlow 1.14). For right now, the workaround is to downgrade Flask with:
After starting the server with If the model was trained on IMDB, this should display the following in the browser:
|
It's a good suggestion but it does not work for me, I get: |
Has anyone tried using TensorFlow Serving with ktrain? |
I recall seeing that error, as well, but I think it went away after making sure the version of TensorFlow used to train the model (TensorFlow 2.0) was the same as the version used to serve the model (TensorFlow 2.0). If you're using TF 1.14/1.15, maybe also try upgrading to TF 2.0. Also, make sure there are no calls to standalone Keras in any of your code. The example above works with TF 2.0 and ktrain v 0.7.2. |
I am using: tensorflow==2.0.0 and still get the error. |
It turns out that |
Great. I've edited the example above to include this and also removed debugging mode. |
Hi Guys thanks for the response i already have deployed ktrain model by converting it into h5 and json type you can check this Notebook and if you have any suggestion for improvement please tell us |
Would anyone know why Flask==1.1.1 throws an: |
Thank you. |
I just discovered ktrain and and it is so unique! |
Hi, i have an issue regarding deployment i am not able to deploy ktrain multi text classification model. I tried to load model and .preproc file but it does not work.
The text was updated successfully, but these errors were encountered: