kitzeslab / opensoundscape

Open source, scalable software for the analysis of bioacoustic recordings
http://opensoundscape.org
MIT License
126 stars 14 forks source link

Tutorial showing best practice for saving models to use in later opso versions #965

Open louisfh opened 3 months ago

louisfh commented 3 months ago

The documentation mentions using model.save_torch_dict and CNN.from_torch_dict to save and load model weights between opensoundscape versions, but there's no tutorial. I think it would be helpful to have a tutorial showing this.

e.g. something like

# save the model
model.save_torch_dict...
# load the model
CNN.from_torch_dict...

# recreate the preprocessor, make sure the settings are the same as in the old version!
hop_size = 256
window_length = 512
preprocessor = ....