stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

Importing from timm.models.layers is deprecated/`resume_download` is deprecated

Open zd391 opened this issue 1 year ago • 12 comments

Checklist

  • [ ] The issue exists after disabling all extensions
  • [ ] The issue exists on a clean installation of webui
  • [ ] The issue is caused by an extension, but I believe it is caused by a bug in the webui
  • [ ] The issue exists in the current version of the webui
  • [ ] The issue has not been reported before recently
  • [ ] The issue has been reported before but has not been fixed yet

What happened?

Importing from timm.models.layers is deprecated, resume_download is deprecated,

Steps to reproduce the problem

D:\stable-diffusion-webui\venv\lib\site-packages\timm\models\layers_init_.py:48: FutureWarning: Importing from timm.models.layers is deprecated, please import via timm.layers warnings.warn(f"Importing from {name} is deprecated, please import via timm.layers", FutureWarning) D:\stable-diffusion-webui\venv\lib\site-packages\huggingface_hub\file_download.py:797: FutureWarning: resume_download is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use force_download=True.

What should have happened?

How should I import (resume_download/timm.models.layers) or ignore the warning?

What browsers do you use to access the UI ?

Google Chrome

Sysinfo

"Platform": "Windows-10-10.0.19045-SP0", "Python": "3.10.11", "Version": "v1.10.1",

Console logs

(venv) PS D:\stable-diffusion-webui> .\webui-user.bat
venv "D:\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.11 | packaged by Anaconda, Inc. | (main, Apr 20 2023, 18:56:50) [MSC v.1916 64 bit (AMD64)]
Version: v1.10.1
Commit hash: 82a973c04367123ae98bd9abdf80d9eda9b910e2
Launching Web UI with arguments: --xformers
D:\stable-diffusion-webui\venv\lib\site-packages\timm\models\layers\__init__.py:48: FutureWarning: Importing from timm.models.layers is deprecated, please import via timm.layers
  warnings.warn(f"Importing from {__name__} is deprecated, please import via timm.layers", FutureWarning)
Loading weights [6ce0161689] from D:\stable-diffusion-webui\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors
Creating model from config: D:\stable-diffusion-webui\configs\v1-inference.yaml
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
D:\stable-diffusion-webui\venv\lib\site-packages\huggingface_hub\file_download.py:797: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
  warnings.warn(
Startup time: 22.9s (prepare environment: 5.0s, import torch: 7.9s, import gradio: 2.0s, setup paths: 1.9s, initialize shared: 0.9s, other imports: 1.0s, load scripts: 2.4s, create ui: 0.8s, gradio launch: 1.1s).
Applying attention optimization: xformers... done.
Model loaded in 6.7s (load weights from disk: 1.0s, create model: 0.9s, apply weights to model: 3.8s, calculate empty prompt: 0.7s).

Additional information

No response

zd391 avatar Oct 28 '24 02:10 zd391

the same as

hotick avatar Oct 28 '24 08:10 hotick

Facing same problem as well. Also Stable diffusion doesnt even generate anything whilst it gets my gpu to 100% usage

ShtifflesMetMe avatar Oct 31 '24 13:10 ShtifflesMetMe

timm==1.0.11 display Warning timm<=1.0.10 works fine

hotick avatar Nov 03 '24 04:11 hotick

Checklist

  • [ ] The issue exists after disabling all extensions
  • [ ] The issue exists on a clean installation of webui
  • [ ] The issue is caused by an extension, but I believe it is caused by a bug in the webui
  • [ ] The issue exists in the current version of the webui
  • [ ] The issue has not been reported before recently
  • [ ] The issue has been reported before but has not been fixed yet

What happened?

Importing from timm.models.layers is deprecated, resume_download is deprecated,

Steps to reproduce the problem

D:\stable-diffusion-webui\venv\lib\site-packages\timm\models\layers__init__.py:48: FutureWarning: Importing from timm.models.layers is deprecated, please import via timm.layers warnings.warn(f"Importing from {name} is deprecated, please import via timm.layers", FutureWarning) D:\stable-diffusion-webui\venv\lib\site-packages\huggingface_hub\file_download.py:797: FutureWarning: resume_download is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use force_download=True.

What should have happened?

How should I import (resume_download/timm.models.layers) or ignore the warning?

What browsers do you use to access the UI ?

Google Chrome

Sysinfo

"Platform": "Windows-10-10.0.19045-SP0", "Python": "3.10.11", "Version": "v1.10.1",

Console logs

(venv) PS D:\stable-diffusion-webui> .\webui-user.bat
venv "D:\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.11 | packaged by Anaconda, Inc. | (main, Apr 20 2023, 18:56:50) [MSC v.1916 64 bit (AMD64)]
Version: v1.10.1
Commit hash: 82a973c04367123ae98bd9abdf80d9eda9b910e2
Launching Web UI with arguments: --xformers
D:\stable-diffusion-webui\venv\lib\site-packages\timm\models\layers\__init__.py:48: FutureWarning: Importing from timm.models.layers is deprecated, please import via timm.layers
  warnings.warn(f"Importing from {__name__} is deprecated, please import via timm.layers", FutureWarning)
Loading weights [6ce0161689] from D:\stable-diffusion-webui\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors
Creating model from config: D:\stable-diffusion-webui\configs\v1-inference.yaml
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
D:\stable-diffusion-webui\venv\lib\site-packages\huggingface_hub\file_download.py:797: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
  warnings.warn(
Startup time: 22.9s (prepare environment: 5.0s, import torch: 7.9s, import gradio: 2.0s, setup paths: 1.9s, initialize shared: 0.9s, other imports: 1.0s, load scripts: 2.4s, create ui: 0.8s, gradio launch: 1.1s).
Applying attention optimization: xformers... done.
Model loaded in 6.7s (load weights from disk: 1.0s, create model: 0.9s, apply weights to model: 3.8s, calculate empty prompt: 0.7s).

Additional information

No response

i guess this is not a big problem that can effect the program, i also am getting this error whenever i open it. i did tested with some generated public images and it very much generated the same image when i'm generating.

linuarM avatar Nov 03 '24 20:11 linuarM

i am having this same issue when i try to generate anything it just sits there :\

dlinvader avatar Nov 04 '24 16:11 dlinvader

Same warning here. I went to the directory of the warning, in my case it's

F:\SD-webui\SD-webui-F\venv\lib\site-packages\timm\models\layers\__init__.py:48: FutureWarning: Importing from timm.models.layers is deprecated, please import via timm.layers

indicating line 48 of the init__.py file, which I opened in Notepad++

2024-11-04 Notepad++ py48 future warning

Line 48 is the last line in the init__.py file. It appears that this is exactly what it says 'a future warning'. It's a placeholder for {__name__} which would in future be populated with the name of whichever timm. is problematic.

Can be ignored if the {__name__} name is unpopulated; address the warning in future if that changes to a problematic timm.

dyslecix avatar Nov 04 '24 19:11 dyslecix

Same here, I was having issues with Automatic1111 so I reinstalled it, but now I am getting the error message from a fresh install.

ArxFusion avatar Jan 06 '25 12:01 ArxFusion

"Python": "3.10.11", "Version": "v1.10.1", as same as,who can solve this problem, waitting on line...

bigfly999 avatar Mar 04 '25 03:03 bigfly999

Any one got a solution for this future warning error? new Comfyui version got installed timm==1.0.15 and is displaying this warning, rolling back to timm==1.0.10 solves the error but not sure how it affects comfy

Vision25th avatar Mar 23 '25 04:03 Vision25th

same problem plus: 3x "No module 'xformers'. Proceeding without it" error and i can't local share link (config code is correct)

renega51 avatar Mar 23 '25 19:03 renega51

Same problem here

MaxNMV avatar Apr 05 '25 13:04 MaxNMV

I don't know if this will help everyone, but I was able to fix this error on my system by deleting my custom node folders one at a time and restoring until it went away. The culprit was Comfyui-Pulid-Flux-Enhanced. The eva_vit_model.py had some code right at the top that AI suggested I change. My resulting code is this, (see below) with the error gone and the nodes still working fine. If you're unsure about editing the code and afraid you're going to mess things up, make a copy of it first and save it somewhere else, edit your current eva_vit_model.py in the folder, reboot, and see. If it didn't fix the problem, replace the current file you just edited with the one you made a copy of. You can also give it to ChatGPT and ask it to edit and return it to you. Good luck!

Location C:\ComfyUI\custom_nodes\ComfyUI-PuLID-Flux-Enhanced\eva_clip

File: eva_vit_model.py

Code:

--------------------------------------------------------

Adapted from https://github.com/microsoft/unilm/tree/master/beit

--------------------------------------------------------

import math import os from functools import partial import torch import torch.nn as nn import torch.nn.functional as F from timm.layers import drop_path, to_2tuple, trunc_normal_

from .transformer import PatchDropout from .rope import VisionRotaryEmbedding, VisionRotaryEmbeddingFast

Magus2012 avatar Apr 09 '25 16:04 Magus2012

This tip is just an early indication of the changes that will be made to the code by the timm dependency package in the future. To remind developers to change the introduction method, in fact, there is no effect, ComfyUI-PuLID-Flux-Enhanced plugin in the eva_vit_model.py file in the introduction of the timm dependency, but also to do a compatible in order to support the introduction of the current introduction method and the introduction of the future way, I see above someone said that the installation of the 1.0.10 version, no longer appear this warning message, that's because the previous version of the code did not add this warning message. But to be honest, it's a real pain in the ass to look at.

water110 avatar May 10 '25 09:05 water110