Skip to content

Pickle is unable to load a SHAP explainer object #285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
johnkuangwork opened this issue Sep 29, 2021 · 1 comment
Closed

Pickle is unable to load a SHAP explainer object #285

johnkuangwork opened this issue Sep 29, 2021 · 1 comment

Comments

@johnkuangwork
Copy link

johnkuangwork commented Sep 29, 2021

Hi, I am trying to load a SHAP explainer object but failed to launch gradio hosting. But there is no issue run and launch on local juypterlab...

explainer = pickle.load(file), seems unable to run...any ideas? thank you!!!

Error message:

  | Starting container...
  | public: http://54.185.190.133:7860/
  | IPython could not be loaded!
  | Trying to unpickle estimator DecisionTreeClassifier from version 0.24.2 when using version 1.0. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:
  | https://scikit-learn.org/stable/modules/model_persistence.html#security-maintainability-limitations
  | Trying to unpickle estimator RandomForestClassifier from version 0.24.2 when using version 1.0. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:
  | https://scikit-learn.org/stable/modules/model_persistence.html#security-maintainability-limitations
  | Traceback (most recent call last):
  | File "Online V1.py", line 39, in <module>
  | explainer = pickle.load(file)
  | File "/usr/local/lib/python3.7/site-packages/numba/core/serialize.py", line 97, in _unpickle__CustomPickled
  | ctor, states = loads(serialized)
  | TypeError: code() takes at most 15 arguments (16 given)

@abidlabs
Copy link
Member

abidlabs commented Oct 7, 2021

It looks like this is an issue with different version of Python (see this for example: RedisGears/redisgears-py#13). Gradio Hosted runs Python 3.7, so if you can make sure the explainer was pickled on a system running Python 3.7, it should work.

@abidlabs abidlabs closed this as completed Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants