Restoring local model does not load mean and std
Description:
When specifying a local path to a pre-trained .pth model via the restore_model field in experiments.csv, the expected mean and std values are not loaded. As a result, the training process fails with:
Exception: No file found at f{mean_path}
This happens because the logic in experiment.py only calls download_model() (which sets and saves the normalization parameters) if restore_model does not end with .pth: https://gitlab.teklia.com/dla/doc-ufcn/-/blob/main/doc_ufcn/train/experiment.py?ref_type=heads#L253
Therefore, if a user specifies a local .pth model, the mean and std files are not generated, but are still expected later in get_mean_std().
Steps to Reproduce:
- Set
restore_modelinexperiments.csvto a local path - Remove any existing mean and std files
- Run the training script
- Observe the error in
get_mean_std()due to missing files
Are there still things that I have not taken into account or is loading the values from an existing model incorrect?
Thank you very much in advance!
Best regards,
Constantin