pplonski / my_ml_service

My Machine Learning Web Service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Index out of range

zarabash opened this issue · comments

commented

Hello, I am using your guide for an obesity dataset. Everything works fine on local. But when I deployed on PaaS, I keep getting this error whenever I want to post for a prediction:

IndexError at /obesity/v1/comorbidities_classifier/predict
list index out of range

And it is referring to line "algorithm_object = registry.endpoints[algs[0].id]"

Can you perhaps guide me on this? Thanks.

commented

Hi, could you please add print with algs and endpoints before the line with error to check what is inside them? Probably one of them is empty.

commented

Hey thanks for your reply. I got these

alg_index 0
algorithm_status 'production'
algorithm_version None
algs <QuerySet [<MLAlgorithm: MLAlgorithm object (15)>, <MLAlgorithm: MLAlgorithm object (16)>, <MLAlgorithm: MLAlgorithm object (17)>, <MLAlgorithm: MLAlgorithm object (18)>]>
endpoint_name 'comorbidities_classifier'
format None
request <rest_framework.request.Request: POST '/obesity/v1/comorbidities_classifier/predict'>
self <obesityendpoints.views.PredictView object at 0x7f0f2bba47f0>