Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError of timm.models.layers.helpers with timm 0.9.2 #58

Open
mcollinswisc opened this issue Jun 1, 2023 · 0 comments
Open

Comments

@mcollinswisc
Copy link

With timm 0.9.2 installed, running the example toolbox.py command, I see an error:

Traceback (most recent call last):
  File "/home/mcollins/repo/external/EfficientFormer/toolbox.py", line 6, in <module>
    from models import *
  File "/home/mcollins/repo/external/EfficientFormer/models/__init__.py", line 1, in <module>
    from .efficientformer import efficientformer_l1, efficientformer_l3, efficientformer_l7
  File "/home/mcollins/repo/external/EfficientFormer/models/efficientformer.py", line 15, in <module>
    from timm.models.layers.helpers import to_2tuple
ModuleNotFoundError: No module named 'timm.models.layers.helpers'

I believe this is due to the changes described at:
https://github.com/huggingface/pytorch-image-models/tree/cd950e6583bd4c5961d88059ff669149d100a1d1#whats-new

timm.models.layers moved to timm.layers

Though I am not sure why the described deprecation mapping doesn't still work for the helpers module.

I see two possible changes that would address this:

  1. Update imports of timm.models.layers.helpers to the new location at timm.layers.helpers (and other imports from timm.layers)
  2. Specify the version of timm to be < 0.9 in requirements.txt

I could send a PR for either change if desired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant