Open Erotemic opened 1 year ago
The simplest way - load transforms using old library version and save them using ours serialization to json/yaml. You can then load these transforms from newer versions of the library. https://albumentations.ai/docs/examples/serialization/#Serializing-an-augmentation-pipeline-to-a-JSON-or-YAML-file
🐛 Bug
I have an older torch.package model where the author baked in a few albumentations objects. Using the latest version of albumentations breaks because
albumentations.core.composition.Transforms
no longer exists.Here is a MWE:
In the above code, I have a copy of this repo, and I checkout the 1.1.0 tag, and run
mwe.py save
to save the object. Runningmwe.py load
works fine in this branch. But when I update to a later branch e.g. 1.3.0, running load results in:Is there a monkey patch I can make that allows me to load these older pickles without having to pin my version of albumentations to something old? Alternatively (although less desirable), is there a way to update the pickle file so it works with newer versions?