[BUG] AttributeError: module 'timm.models._registry' has no attribute 'get_pretrained_cfgs_for_arch' (deprecated import paths) #2306
-
Describe the bug To Reproduce
Expected behavior Desktop (please complete the following information):
Additional context |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
@Benjamin-Tan hmm, there is a small problem in the it should be |
Beta Was this translation helpful? Give feedback.
-
I'll fix it soon and maybe do another release, but could you tell me what's using the old path, do you have any ability to fix it? I will be removing those import hacks in some future release as they are 2 years old now as mentioned. |
Beta Was this translation helpful? Give feedback.
-
I'll do a 1.0.11 release with the fix (on main now) for this. I'm hoping to get one other small addition in first so probably tomorrow. I did expose a lot of uses of the long deprecated import path, sigh. Probably by 2025 I will be removing the backwards compatible import paths like this one with some new, significant additions to |
Beta Was this translation helpful? Give feedback.
-
this fixes it. Thanks for the update. I did not see the warning message while running. I could remove the |
Beta Was this translation helpful? Give feedback.
-
1.0.11 will be out in another 1-2 hours that will fix the issue. I'll move this to discussions once fixed so people have visibility, to re-iterate what I had at the top of the README (but removed recently since it was there so long)
I am going to enable a warning when the deprecated import paths are used though. I should only fire on the first use of each path. so
will spit out this to stderr:
Other common ones like
will spit out this to stderr:
|
Beta Was this translation helpful? Give feedback.
@Benjamin-Tan hmm, there is a small problem in the
_all_
for the registry, but it's being triggered by using a deprecated import path,timm.models.registry
was deprecated as of two years ago https://github.com/huggingface/pytorch-image-models/blob/main/timm/models/registry.pyit should be
from timm.models import register_model