Beta
Beta

Reputation: 1746

Error while loading pkl file using joblib

Following this post, I'm trying to execute the code using joblib. But I'm getting the following error:

classify=joblib.load("traindata.pkl")

ValueError: You may be trying to read with python 3 a joblib pickle generated with python 2. This feature is not supported by joblib.

In the doc, it's saying I'm using python3, that's why getting this error.

How to read the pkl file using python3?

Thank you!

Upvotes: 2

Views: 2400

Answers (1)

Kuzeko
Kuzeko

Reputation: 1705

Unfortunately, you cant!

If you are switching between python versions, you will need to save a different joblib pickle for each python version.

https://pythonhosted.org/joblib/persistence.html#compatibility-across-python-versions

This is pretty hideous, but that's it.

Upvotes: 3

Related Questions