You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These protected attributes are not cleared when saving, and are included in the explainer.dill file. I'm don't have a good example of where this is actually a problem at load time, but we should investigate, and if needed implement a more robust approach to clearing self.predictor. This might be as simple as something like:
We probably shouldn't straight-up delete or set attributes to None as when serialization fails then the explainer is left in a broken state. Instead, the attributes should be cleared whilst maintaining a local variable with a reference to the object and if for some reason serialization fails we can reset the references to restore the explainer to its state pre-calling .save.
When saving explainers, the
predictor
attribute is set toNone
to avoid attempting to save it, and it is then given toload_explainer
at load time:alibi/alibi/saving.py
Lines 110 to 112 in c2da012
However, some explainers, such as
AnchorTabular
, set other protected attributes just as_predictor
when setting thepredictor
property:alibi/alibi/explainers/anchors/anchor_tabular.py
Lines 979 to 999 in c2da012
These protected attributes are not cleared when saving, and are included in the
explainer.dill
file. I'm don't have a good example of where this is actually a problem at load time, but we should investigate, and if needed implement a more robust approach to clearingself.predictor
. This might be as simple as something like:and then
del explainer.predictor
in_simple_save
.The text was updated successfully, but these errors were encountered: