1

While Deploying iris prediction model using flasgger API, i can enter the lengths and widths of the iris flower with http/200 ok , but i do not see an xml output with the prediction results.

Flassger api docs iris prediction

From ipython notebook:

  • Running on http://127.0.0.1:5001/ (Press CTRL+C to quit) 127.0.0.1 - - [20/Jan/2020 17:16:23] "GET /predict?s_length=3.2&s_width=2.0&p_length=3.0&p_width=4.5 HTTP/1.1" 200 - 127.0.0.1 - - [20/Jan/2020 17:16:23] "GET /favicon.ico HTTP/1.1" 404 - 127.0.0.1 - - [20/Jan/2020 17:16:47] "GET /apidocs/ HTTP/1.1" 200 - 127.0.0.1 - - [20/Jan/2020 17:16:47] "GET /flasgger_static/swagger-ui.css HTTP/1.1" 200 - 127.0.0.1 - - [20/Jan/2020 17:16:47] "GET /flasgger_static/swagger-ui-bundle.js HTTP/1.1" 200 - 127.0.0.1 - - [20/Jan/2020 17:16:47] "GET /flasgger_static/swagger-ui-standalone-preset.js HTTP/1.1" 200 - 127.0.0.1 - - [20/Jan/2020 17:16:48] "GET /flasgger_static/lib/jquery.min.js HTTP/1.1" 200 - 127.0.0.1 - - [20/Jan/2020 17:16:48] "GET /apispec_1.json HTTP/1.1" 200 - 127.0.0.1 - - [20/Jan/2020 17:16:48] "GET /flasgger_static/favicon-32x32.png HTTP/1.1" 200 - 127.0.0.1 - - [20/Jan/2020 17:17:03] "GET /predict?s_length=4.2&s_width=5.6&p_length=2.6&p_width=6.3 HTTP/1.1" 200 -
amitk
  • 143
  • 1
  • 1
  • 9

2 Answers2

2

Hope you all are keeping well.

So i found the problem after few days of struggling with it, looking for solution ,I guess i was too lazy to post it on GitHub or maybe got busy , the error indicated above was a result of incomplete XML missing 200 body for an HTTP Response , which did not output any XML Result when I entered the input parameters and run the prediction from the GUI , which is expected in my case.

So it is important that we provide a complete XML body with 200 response , we can also add the kind of results you would expect under the 200 XML Body for the prediction based on your Project.

Adding the 200 in the XML body as shown below, fixed the problem.

def predict_iris_file():
"""Example file endpoint returning a prediction of iris
---
parameters:
- name: input_file
in: formData
type: file
required: true
responses:
200:
description: "0: Iris-setosa, 1: Iris-versicolor, 2: Iris-virginica"
"""

Regards akudnaver

amitk
  • 143
  • 1
  • 1
  • 9
1

Sorted the issue. Responses should be in the same indent as parameters and 200 should be indented below responses

thepratman
  • 13
  • 2