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
Use of dill as a module in Alibi causes problems if a user runs joblib #447
Comments
Pretty bad behaviour from |
This might adds some background: uqfoundation/dill#383 (comment) |
@cliveseldon I can't reproduce this either in Python 3.8 or Python 3.7, regardless whether I load |
Did you test by saving in an environment where dill is present and loading in an environment where dill is not present? |
I see, I can reproduce the issue now when |
The culprit is this function: https://github.com/uqfoundation/dill/blob/4bdc5dfa501c536aa9b7415b13c58947e6409773/dill/__init__.py#L95 Basically, just by importing A solution would be to do the following in import dill
from dill import extend
extend(use_dill=False) However, we should check if after calling the above, the using the Edit: Looking at the following line it might be the case that indeed |
Inspecting the source code and the dispatch tables I've confirmed that calling It feels prudent to call |
I ran moviesentiment notebook: https://github.com/SeldonIO/alibi/blob/master/examples/anchor_text_movie.ipynb
After training of sklearn model I added a new line to save model using joblib:
Loading that into a new environment with sklearn fails with:
This would seem to be due to dill "magic" where it on load disrupts some core python module handling that means it can cause problems when a user uses joblib.
This is fine if a user knows dill is active but the above import of dill is hidden inside alibi module.
The text was updated successfully, but these errors were encountered: