Microservice API returning empty prediction?

I’d like to host an API that can predict classifications. I’ve got the bear classification example hosted on render working.

In theory I should just POST requests to /analyze and I will receive a JSON of {‘result’: str(prediction)}. See @app.route(’/analyze’, methods=[‘POST’]).

Unfortunately, when I make the simulate makine the call remotely (from to /analyse on, the returned responseText is empty. Does anyone know why? It should have the prediction…


This is the analyse function I run from It is taken from here in the render example mentioned above. However I’ve modified the code so it doesn’t look for an image the user has uploaded to the page, and instead fetches “https://upload.wikimedia.org/wikipedia/commons/7/77/Delete_key1.jpg”. Ultimately I want to replace this with whatever image I submit via the API call, but I need to fix the empty responseText I’m getting first. Any ideas please?

1 Like