bluedatamlops

bluedata mlops prediction - 'NoneType' object does not support item assignment


I'm calling the BlueData MLOPS prediction API to get a score for my model, but I'm getting the following response:

============================response begin==========================================
Status code  : {}200
Status text  : {}OK
Headers      : {}{Server=[gunicorn/19.9.0], Date=[Sat, 23 Nov 2019 12:16:43 GMT], Content-Type=[text/html; charset=utf-8], Content-Length=[50]}
Response body: {}'NoneType' object does not support item assignment
=======================response end=================================================

What could be causing this?


Solution

  • On closer inspection of my request, I noticed that I had the content type set to text/plain:

    ===========================request begin================================================
    URI         : {}http://xxxx:10026/diabetes%20model/1/predict
    Method      : {}POST
    Headers     : {}{Accept=[application/json], X-Auth-Token=[6EMbYcQsBD], Content-Type=[text/plain;charset=ISO-8859-1], Content-Length=[174], Accept-Charset=[big5, ...]}
    Request body: {}{"use_scoring": true, "scoring_args": {"NumPreg":1.0,"Glucose": 85.0,"BloodPressure": 66.0,"SkinThick": 29.0,"Insulin": 0.0,"BMI": 26.6,"DiabetesPedFunc": 0.351,"Age": 35.0}}
    ==========================request end===================================================
    

    Changing that to application/json resolved the issue for me.