bluedata mlops 预测 - 'NoneType' 对象不支持项目分配

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

我正在调用 BlueData MLOPS 预测 API 以获得我的模型的分数,但我收到以下响应:

============================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=================================================

可能是什么原因造成的?

仔细检查我的请求后,我注意到我将内容类型设置为 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===================================================

将其更改为 application/json 解决了我的问题。