Validation Error after uploading ML Package

Hello all,

After uploading my ML package the status will go directly to “Validation Error”. What is the source of this error? And how can it be resolved?

I tried to upload a simple ready-to-serve ML package, which I based on the AI Fabric documentation.

I can’t upload the zip file yet. But my main.py file looks like this:

import joblib
import json

class Main(object):
    def __init__(self):
        self.model_path = 'ridge_model_gfi.joblib'
        self.ridge = joblib.load(self.model_path)
         
    def predict(self, X):
       X_array = json.loads(X)
       result = self.ridge.predict(X_array)
       return json.dumps(result.tolist())

My requirements.txt had the following lines:
scikit-learn==0.23.1
joblib==0.16.0

Some extra information:

  • The model predicts a value based on 15 questions answered with 0’s or 1’s.
  • I used a (sklearn) Ridge Regression
  • It was possible to predict locally like this:
if __name__ == '__main__':    
    m = Main()
    a = m.predict('[[1,0,0,0,1,0,1,0,1,0,0,1,0,0,0]]')
    print(a)
1 Like

Hi @d.hamersma

Could you go to ML Logs section. You’ll see a log with validation failed, just click on it, you should have more details about what happened.

Jeremy

3 Likes

Oh wow, did now know about that section. The .zip file had a different name than the folder inside. That’s why I got that error.

Thanks for the help!