Not able to upload pre-trained model to AI Platform

Viewed 290

I have trained a random forest classifier and stored the model as a joblib file on google storage. The ai-platform is giving an error when a version is created using scikit-learn framework with this model.joblib file. The error goes like -:

Create Version failed. Bad model detected with error: "Failed to load model: Could not load the model: /tmp/model/a0001/model.joblib. 0. (Error code: 0)"

The model is 283Mb - well within the allowed size limit.

1 Answers

That error, as you can see in the troubleshooting guide, usually means the wrong library was used to export the model. To correct this, re-export the model using the correct library.

Remember that the joblib library in the AI Platform is imported doing:

from sklearn.externals import joblib

You have an example of how to export it here.

Related