8

I am trying to load a model saved as a .joblib file. I have tried pickle, sklearn.externals.joblib and joblib itself. All the same error. Below is an example of what I am trying to do.

 clf = joblib.load("linear_regression_model.joblib")

This model was made using sklearn.linear_model.LinearRegression. However, when I try to open this file, I get this error:

ModuleNotFoundError: No module named 'sklearn.linear_model._base'

Package Versions:

Python 3.7.5

Sklearn 0.21.3

Joblib 0.14.0

Scipy 1.3.2

Any idea of what is going on? Thanks in advance.

Natalie
  • 447
  • 1
  • 4
  • 16
  • 3
    Did you changed the sklean version (After saving model or did you saved the model in other system and loading it elsewhere) ?, Can you try changing the directory and load the model again? – Yash Kumar Atri Dec 10 '19 at 07:17

1 Answers1

14

Figured it out. The model was created on a different system with a different version of sklearn. Loading in the model on the same system it was created on caused no problems.

Natalie
  • 447
  • 1
  • 4
  • 16