-
Describe the bug I'm trying to load swin transformer in a kaggle's offline environment. While it ran without issue yesterday, it now fails to load with a To Reproduce
Expected behavior Error message
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
@eesoymilk latest timm versions (0.9.x) use the huggingface hub for weights by default now, that takes priority over the torch hub cache, many weights have been remapped for model changes so best download via HF hub. Kaggle really should support passing through HF hub or at least caching it properly but they seem to have no interest in making things simpler for people so the manual caching of weights in datasets madness continues... To override pretrained location, you download the weights file manually from the hub and try the following. timm.create_model(
'swinv2_large_window12to16_192to256',
pretrained=True,
pretrained_cfg_overlay=dict(file='path/to/checkpoint'),
) where checkpoint is a .safetensors/.bin/.pth/.pt etc file... |
Beta Was this translation helpful? Give feedback.
-
moving to discussions for future reference |
Beta Was this translation helpful? Give feedback.
-
@rwightman can you pls point me what is the default path where loaded models are stored in 0.9.x versions? |
Beta Was this translation helpful? Give feedback.
@eesoymilk latest timm versions (0.9.x) use the huggingface hub for weights by default now, that takes priority over the torch hub cache, many weights have been remapped for model changes so best download via HF hub. Kaggle really should support passing through HF hub or at least caching it properly but they seem to have no interest in making things simpler for people so the manual caching of weights in datasets madness continues...
To override pretrained location, you download the weights file manually from the hub and try the following.
where checkpoi…