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
{{ message }}
Repository navigation
Simplify existing resnet API for pretrained flag #7047
Is your feature request related to a problem? Please describe.
The pretrained flag in the resnet50 function currently only accepts a boolean value. If it's set to True, the function throws an error pointing the user to download MedicalNet weights. Then, the user has to download these and manually load the state_dict into the model.
Describe the solution you'd like
This process can be simplified largely by allowing the pretrained flag to take str values that point to a path and automatically loading state_dict from these paths.
This can help with loading the MedicalNet weights more easily and potentially open up this API to loading other models that have been trained with monai as well. If we don't want to support duck typing, then we could also add another flag to the function.
Additional context
I do understand that monai is moving in a different direction with loading bundles etc. but since this pretrained flag still exists, it might be useful to simplify it.
Activity
[-]Simplify existing Resn[/-][+]Simplify existing `resnet` API for `pretrained` flag[/+]Simplify resnet pretrained flag
vgrau98 commentedon Oct 6, 2023
Using gdwon it is possible to download pretrained models developed by https://github.com/Tencent/MedicalNet and published on google drive: https://drive.google.com/u/0/uc?id=13tnSvXY7oDIEloNFiGTsjUIYfS3g3BfG&export=download.
However, there is only one link to all the pre-trained models and other data (abour 2 GB).
Would it be ok if the flag is set to True to download the weights from the drive link even if other useless data is downloaded too?
vgrau98 commentedon Oct 6, 2023
Finally pretrained models seem to be on hugging face: https://huggingface.co/TencentMedicalNet
7047 simplify resnet pretrained (#7095)