Skip to content
Advertisement

Wrapping python+keras+tensorflow ‘as a service’ to receive prediction requests from PHP?

I run a python script in order to load keras, tensorflow and the keras model. Then I can start making predictions, but this takes a few seconds to load everything.

I can loop inside the python script and get good performance predicting in batches, but I want to have also good performance with via independent prediction requests from PHP.

Anyone had success approaching like this? How to make Python script run as service?

Advertisement

Answer

I found a very good solution. Converting my prediction python script into a FLASK app and running the flask app with a Python WSGI HTTP Server called Gunicorn! and it works like a charm!

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement