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
I trained a lot of models on version 0.4.0. After upgrade to 0.5.0 I can't load them anymore, as I get errors like
AttributeError: Can't get attribute 'DecoderBlock' on <module 'segmentation_models_pytorch.decoders.unet.decoder' from '/home/christian/dev/HSP/libraries/atnc_mcv/venv/lib/python3.12/site-packages/segmentation_models_pytorch/decoders/unet/decoder.py'>
So, how can I keep using my trained models with the new version?
Thanks, Christian
The text was updated successfully, but these errors were encountered:
Hi @ChristianWiele, it depends on the models you have trained. state_dicts should be backward compatible, so saving weights in 0.4.0 and loading them in 0.5.0 should work. In case you save the entire model (troch.save(model)), I would recommend loading it in v 0.4.0, saving with save_pretrained and then loading in 0.5.0 with from_pretrained - this should work.
Hi @qubvel, thanks for the quick response. This seems to work. I use mlflow to save my models which uses torch.save() . I guess there is no direct way to use save_pretrained with mlflow!?
I'm not very familiar with MLflow, not sure if there is a direct way to do that. However, I hope some callbacks exist to override the default behaviour.
Hi,
I trained a lot of models on version 0.4.0. After upgrade to 0.5.0 I can't load them anymore, as I get errors like
AttributeError: Can't get attribute 'DecoderBlock' on <module 'segmentation_models_pytorch.decoders.unet.decoder' from '/home/christian/dev/HSP/libraries/atnc_mcv/venv/lib/python3.12/site-packages/segmentation_models_pytorch/decoders/unet/decoder.py'>
So, how can I keep using my trained models with the new version?
Thanks, Christian
The text was updated successfully, but these errors were encountered: