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

cannot import name 'ImageNetInfo' from 'timm.data' #272

Open
cYREXE opened this issue Jan 11, 2025 · 13 comments
Open

cannot import name 'ImageNetInfo' from 'timm.data' #272

cYREXE opened this issue Jan 11, 2025 · 13 comments

Comments

@cYREXE
Copy link

cYREXE commented Jan 11, 2025

I've Tried resetting all nodes and reinstalled timm. Im on windows.

Loading text encoder model (llm) from: C:\Users\x\x\x\ComfyUI_windows_portable\ComfyUI\models\LLM\llava-llama-3-8b-text-encoder-tokenizer
!!! Exception during processing !!! Failed to import transformers.models.timm_wrapper.configuration_timm_wrapper because of the following error (look up to see its traceback):
cannot import name 'ImageNetInfo' from 'timm.data' (C:\Users\x\x\x\ComfyUI_windows_portable\python_embeded\Lib\site-packages\timm\data_init_.py)
Traceback (most recent call last):
File "C:\Users\x\x\x\ComfyUI_windows_portable\python_embeded\Lib\site-packages\transformers\utils\import_utils.py", line 1817, in _get_module
return importlib.import_module("." + module_name, self.name)

@festivus37
Copy link

Yeah I haven't used these nodes in a few weeks and did a git pull and now I'm getting the same error.

@kijai
Copy link
Owner

kijai commented Jan 12, 2025

As the error is coming from transformers library, and involves timm library, I'd suggest updating both. I can confirm latest version of both to be working at least, which would be timm-1.0.13 transformers-4.48.0

@festivus37
Copy link

festivus37 commented Jan 12, 2025

I figured it out.

I had to uninstall and reinstall tim. I had 0.6.13, and now I have 1.0.13.

pip uninstall timm

pip install timm --no-cache-dir.

edit: just saw Kijai's post, so came to the same conclusion. you can use the above commands to get there for both.

@mdesnoyelles
Copy link

Hi, thanks for sharing.
I am new to this. Do I go into my Windows path folder? ComfyUI_windows_portable\python_embeded\Lib\site-packages\ then Run and copy Pip uninstall in the terminal. Or it's in another folder?
Cheers

@kijai
Copy link
Owner

kijai commented Jan 14, 2025

Hi, thanks for sharing. I am new to this. Do I go into my Windows path folder? ComfyUI_windows_portable\python_embeded\Lib\site-packages\ then Run and copy Pip uninstall in the terminal. Or it's in another folder? Cheers

You would go to the ComfyUI_windows_portable\python_embeded -folder and run:
python.exe -m pip install -U timm

@curlysasha
Copy link

Hi, thanks for sharing. I am new to this. Do I go into my Windows path folder? ComfyUI_windows_portable\python_embeded\Lib\site-packages\ then Run and copy Pip uninstall in the terminal. Or it's in another folder? Cheers

You would go to the ComfyUI_windows_portable\python_embeded -folder and run: python.exe -m pip install -U timm

this is fixed the issue

@mdesnoyelles
Copy link

Hi, thanks for sharing. I am new to this. Do I go into my Windows path folder? ComfyUI_windows_portable\python_embeded\Lib\site-packages\ then Run and copy Pip uninstall in the terminal. Or it's in another folder? Cheers

You would go to the ComfyUI_windows_portable\python_embeded -folder and run: python.exe -m pip install -U timm

this is fixed the issue

I do not have any error message, as expected. Just a Windows blue screen of death when charging Llama transformers (the second one), it crach after 25% each time. It was working before ConfyUI update. It might be my hardware and I was lucky before.

@imeyefly
Copy link

I am still getting the error:
"Failed to import transformers.models.timm_wrapper.configuration_timm_wrapper because of the following error (look up to see its traceback):
cannot import name 'ImageNetInfo' from 'timm.data' (E:\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-tbox\src\timm\data_init_.py)"

even after i updated timm. trnasformers are at 4.48.0 and I tried the suggested "timm-1.0.13" and the newest "timm-1.0.14". And I still get the same error.

@kijai
Copy link
Owner

kijai commented Jan 20, 2025

I am still getting the error:
"Failed to import transformers.models.timm_wrapper.configuration_timm_wrapper because of the following error (look up to see its traceback):
cannot import name 'ImageNetInfo' from 'timm.data' (E:\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-tbox\src\timm\data_init_.py)"

even after i updated timm. trnasformers are at 4.48.0 and I tried the suggested "timm-1.0.13" and the newest "timm-1.0.14". And I still get the same error.

Are you sure you have it updated in the portable python environment?

@imeyefly
Copy link

imeyefly commented Jan 20, 2025

I am pretty sure. If I search for the timm and transformers folders inside the python_embeded folder and find the correct numbers.

Image

Image

@kijai
Copy link
Owner

kijai commented Jan 20, 2025

I am pretty sure. If I search for the timm and transformers folders inside the python_embeded folder and find the correct numbers.

Image

Image

There's been some custom node packages in the past that actually downgrade transformers upon launch, can't think of anything else then. I can confirm those versions are working for me:

Image

@imeyefly
Copy link

Thanks for the response. I will keep tinkering and hopefully I will figure it out.

@keepctrl
Copy link

Hello,
I'm running the t2v workflow on wsl, timm=1.0.14 and transformers=4.48.0
still getting the error on the text Encoder, any pointer on where I should look for more clues?

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

7 participants