diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b6f334b1..6f4c1840e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,10 +5,9 @@ [Full Changelog](https://github.com/SeldonIO/alibi-detect/compare/v0.10.4...v0.10.5) ### Fixed -- Fixed a bug preventing backward compatibility when loading detectors (containing TensorFlow models) saved with `=v0.10.0` did not properly obey the legacy file format. The `config.toml` file format used by -default in `>=v0.10.0` is not affected. +- Fixed two bugs preventing backward compatibility when loading detectors saved with `=v0.10.0` did not properly obey the legacy file format. The `config.toml` file format used by default in `>=v0.10.0` is unaffected. ## v0.10.4 ## [v0.10.4](https://github.com/SeldonIO/alibi-detect/tree/v0.10.4) (2022-10-21) diff --git a/alibi_detect/saving/tensorflow/_loading.py b/alibi_detect/saving/tensorflow/_loading.py index c102b5449..213402c0c 100644 --- a/alibi_detect/saving/tensorflow/_loading.py +++ b/alibi_detect/saving/tensorflow/_loading.py @@ -233,6 +233,15 @@ def load_detector_legacy(filepath: Union[str, os.PathLike], suffix: str, **kwarg # load outlier detector specific parameters state_dict = dill.load(open(filepath.joinpath(detector_name + suffix), 'rb')) + # Update the drift detector preprocess kwargs if state_dict is from an old alibi-detect version (=v0.10 + # Set x_ref_preprocessed to True + state_dict['kwargs']['x_ref_preprocessed'] = True + # Move `preprocess_x_ref` from `other` to `kwargs` + state_dict['kwargs']['preprocess_x_ref'] = state_dict['other']['preprocess_x_ref'] + # initialize detector model_dir = filepath.joinpath('model') detector: Optional[Detector] = None # to avoid mypy errors