Open roxas122 opened 1 year ago
I had the same problem and it seems to be a fairly new bug. Can't find answers to related questions on google.
try downgrade torchmetrics to torchmetrics==0.11.4
try downgrade torchmetrics to torchmetrics==0.11.4
it work! thank you so much!
Having the same problem. How did you downgrade it?
@jmaiap put torchmetrics==0.11.4 in either requirements.txt or requirements_version.txt. I put it in both so not sure which one fixed it.
I'm sorry but i'm a total noob, where are those files located?
Same problem here, don't know how to fix this issue :(
I think maybe we should add the line in the code.
Having same problem: ImportError: cannot import name '_compare_version' from 'torchmetrics.utilities.imports' (/usr/local/lib/python3.10/dist-packages/torchmetrics/utilities/imports.py)
I cant even uderstand where are this files localed:) I added torchmetrics 0.11.4 upgrade but didnt help
@jmaiap put torchmetrics==0.11.4 in either requirements.txt or requirements_version.txt. I put it in both so not sure which one fixed it.
Where are the requirements.txt or requirements_version.txt located at? I am having the same issue, I need a little guidance on where to edit the file/s? Can someone offer some steps? Most grateful in advance...
for people running on google colab, once clean the runtime and add the torchmetrics==0.11.4 under pip install, then it would be working.
!pip install torchmetrics==0.11.4 torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchtext==0.14.1 torchaudio==0.13.1 torchdata==0.5.1 --extra-index-url https://download.pytorch.org/whl/cu117
for people running on google colab, once clean the runtime and add the torchmetrics==0.11.4 under pip install, then it would be working.
!pip install torchmetrics==0.11.4 torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchtext==0.14.1 torchaudio==0.13.1 torchdata==0.5.1 --extra-index-url https://download.pytorch.org/whl/cu117
Thx,it works~
for people running on google colab, once clean the runtime and add the torchmetrics==0.11.4 under pip install, then it would be working.
!pip install torchmetrics==0.11.4 torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchtext==0.14.1 torchaudio==0.13.1 torchdata==0.5.1 --extra-index-url https://download.pytorch.org/whl/cu117
Any thoughts for those of us running it locally (as opposed to on google colab)? I'm getting the same error and I'm trying to run it on my local machine. Thanks in advance!
@jmaiaptorchmetrics==0.11.4 をrequirements.txtまたはrequirements_version.txtのいずれかに入力します。両方入れたのでどちらで直ったかは分かりません。
requirements.txt またはrequirements_version.txt はどこにありますか? 同じ問題が発生しています。ファイルを編集する場所について少し説明が必要ですか? 誰かがいくつかの手順を提供できますか? よろしくお願いいたします...
私のローカル環境ではファイルはここにありました。 *ドライブレターとインストール先はご自身の環境に読み替えてください。 A:\StableDiffusion\sd.webui\webui\requirements.txt A:\StableDiffusion\sd.webui\webui\requirements_versions.txt
両方のファイルにこれを記述して改善しました。 torchmetrics==0.11.4
I am getting similar error : 17 from datetime import timedelta 18 from typing import Any, Dict, Optional, Union ---> 20 from torchmetrics.utilities.imports import _compare_version 22 import pytorch_lightning as pl 23 from pytorch_lightning.callbacks.progress.base import ProgressBarBase
ImportError: cannot import name '_compare_version' from 'torchmetrics.utilities.imports' (/home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages/torchmetrics/utilities/imports.py)
I tried all the above suggestion but nothing is working. Please help.
for people running on google colab, once clean the runtime and add the torchmetrics==0.11.4 under pip install, then it would be working.
!pip install torchmetrics==0.11.4 torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchtext==0.14.1 torchaudio==0.13.1 torchdata==0.5.1 --extra-index-url https://download.pytorch.org/whl/cu117
Done it But still have this ImportError: cannot import name '_compare_version' from 'torchmetrics.utilities.imports' (/usr/local/lib/python3.10/dist-packages/torchmetrics/utilities/imports.py)
Add “torchmetrics==0.11.4” in red circle
Add “torchmetrics==0.11.4” in red circle在红色圆圈中添加“火炬度量==0.11.4”
ty,very useful
It works, thanks a lot!
It works, thanks a lot! How is this problem solved ? I still can't make it work following the method above.
It works, thanks a lot! How is this problem solved ? I still can't make it work following the method above.
just add this "torchmetrics==0.11.4" to your torch install command.
If you're working in Docker containers follow this solution to adjust the version of torchmetrics: https://github.com/AbdBarho/stable-diffusion-webui-docker/issues/540#issuecomment-1625697493
Not all installers are gonna have that "requierements" folder. Mine doesn't. Upgrading to 0.11.4 does nothing.
Same problem - running Windows and erroring out with the Torchmetrics error. For the sake of the terminal Luddite that I am, can anyone provide clean and concise instructions to cure it on Windows please?
can anyone provide clean and concise instructions to cure it on Windows please?
Not all installers are gonna have that "requierements" folder. Mine doesn't. Upgrading to 0.11.4 does nothing.
@Spawn888 @Reibubba
After installing with the bat or sh, open the invokeai
folder in terminal or cmd and run source .venv/bin/activate
(or in Windows: .venv\Scripts\activate
), then pip install torchmetrics==0.11.4
. That worked for me.
It doesn't work in my project. I have tried to add it into requriments.txt with version and without version, or just install by pip with version and without version. All of those doesn't work. What could I do?
Is there is fix on Archlinux?
mportError: cannot import name '_compare_version' from 'torchmetrics.utilities.imports' (/home/ht/invokeai/.venv/lib/python3.10/site-packages/torchmetrics/utilities/imports.py)
这是来自QQ邮箱的假期自动回复邮件。 您好,我最近正在休假中,无法亲自回复您的邮件。
can anyone provide clean and concise instructions to cure it on Windows please?
Not all installers are gonna have that "requierements" folder. Mine doesn't. Upgrading to 0.11.4 does nothing.
@Spawn888 @Reibubba After installing with the bat or sh, open the
invokeai
folder in terminal or cmd and runsource .venv/bin/activate
(or in Windows:.venv\Scripts\activate
), thenpip install torchmetrics==0.11.4
. That worked for me. it work.thank you very much.it in mac pro.
can anyone provide clean and concise instructions to cure it on Windows please?
Not all installers are gonna have that "requierements" folder. Mine doesn't. Upgrading to 0.11.4 does nothing.
@Spawn888 @Reibubba After installing with the bat or sh, open the
invokeai
folder in terminal or cmd and runsource .venv/bin/activate
(or in Windows:.venv\Scripts\activate
), thenpip install torchmetrics==0.11.4
. That worked for me.
Hi, as my name shows, I'm a total noob. So I tried doing what you said on my local machine and then it says " The module '.venv' could not be loaded. For more information, run 'Import-Module .venv'"
this is running terminal on the folder itself and also on the install bat file.
Then I just skipped to install torch 0.11.4 and it says it's already installed.
And of course none of this works to fully install invoke. Any further help would be much appreciated.
Hi, as my name shows, I'm a total noob. So I tried doing what you said on my local machine and then it says " The module '.venv' could not be loaded. For more information, run 'Import-Module .venv'"
this is running terminal on the folder itself and also on the install bat file.
Then I just skipped to install torch 0.11.4 and it says it's already installed.
And of course none of this works to fully install invoke. Any further help would be much appreciated.
From that error message it sounds like you're using powershell, which would make sense as I think terminal in windows defaults to using powershell.
In that case you should try .venv\Scripts\Activate.ps1
rather than .venv\Scripts\activate
. Then you should be able to run pip install torchmetrics==0.11.4
.
Also make sure you're inside the invokeai
folder when you do this. You can get there with cd "path"
where path
is the path to the invokeai
folder. For example, if your username is John
, and invokeai
is located in your user directory, you'd use cd "C:\Users\John\invokeai"
.
If .venv\Scripts\Activate.ps1
gives you trouble just try using command prompt instead and go with .venv\Scripts\activate
.
Hope this helps.
Had this problem trying to install/run it locally. Just had to run updates.bat then run.bat a second time and it fixed it.
can anyone please help me. I have no idea what any of this means? where do I input that code. speak to me like a child .
For the people having trouble. I was in the same boat nothing I did solved anything. I just went ahead and followed the one click install video on youtube by aiimages and it works. Just make sure you use a third party unzip tool when extracting the files.
Solved upgrading libs (DedrickCheng comment), than updating webui from GIT
pip install -q torch==2.0.0+cu118 torchmetrics==0.11.4 torchvision==0.15.1+cu118 torchaudio==2.0.1+cu118 torchtext==0.15.1 torchdata==0.6.0 --extra-index-url https://download.pytorch.org/whl/cu118 -U
pip install -q xformers==0.0.19 triton==2.0.0 -U
git -C "webui" pull
webui-user.bat
ImportError: cannot import name '_compare_version' from 'torchmetrics.utilities.imports’ I modify the source code of rich_progress.py and fix this error: In the venv/lib/python3.8/site-packages/pytorch_lightning/callbacks/progress/richprogress.py delete the '\' of '_compare_version':
ImportError: cannot import name '_compare_version' from 'torchmetrics.utilities.imports’ I modify the source code of rich_progress.py and fix this error: In the venv/lib/python3.8/site-packages/pytorch_lightning/callbacks/progress/richprogress.py delete the '' of '_compare_version':
thanks! it really works!!
ImportError: cannot import name '_compare_version' from 'torchmetrics.utilities.imports’ I modify the source code of rich_progress.py and fix this error: In the venv/lib/python3.8/site-packages/pytorch_lightning/callbacks/progress/richprogress.py delete the '' of '_compare_version':
Legend! Finally got it working again for me. massive respect
ImportError: cannot import name '_compare_version' from 'torchmetrics.utilities.imports’ I modify the source code of rich_progress.py and fix this error: In the venv/lib/python3.8/site-packages/pytorch_lightning/callbacks/progress/richprogress.py delete the '' of '_compare_version':
hey what if I simply don't have "compare_version" lines in rich_progress.py?
lines in rich_progress.py Emmm.. May you checks the contents of RequirementCache? And my pytorch-lightning version is 1.9.4
lines in rich_progress.py Emmm.. May you checks the contents of RequirementCache? And my pytorch-lightning version is 1.9.4
I was confused, sorry, i tried your solution and it worked. Thank you
Still have this problem. Help pls. Adding this text "torchmetrics==0.11.4" didn`t help((
ImportError Traceback (most recent call last)
17 frames
/usr/local/lib/python3.10/dist-packages/PIL/ImageFont.py in
ImportError: cannot import name 'isDirectory' from 'PIL._util' (/usr/local/lib/python3.10/dist-packages/PIL/_util.py)
NOTE: If your import is failing due to a missing package, you can manually install dependencies using either !pip or !apt.
To view examples of installing some common dependencies, click the "Open Examples" button below.
try downgrade torchmetrics to torchmetrics==0.11.4
I don't know how to downgrade, none of this means anything, people say "pip install torchmetrics==0.11.4" but, where? Any folder on my PC, the rout webui for stable diffusion. Someone said uninstall torchmetrics, but how? I've tried the pip install in the venv folder and I've tried in the rout webui folder but, I'm still getting this same error. I've even tried a clean install of the aug 1st install for SD but I'm still getting the same issue. I've deleted the venv folder and I get the same issue. Actually I've had several issues that may as well be written in Cantonese for all I understand them. I never used a PC until a couple of years ago. I've always used Macs so this is all just blahdiblah to me. Please help. I am royally regretting updating my SD yesterday morning. How do you know if you're going to be downloading a whole heap of trouble? Thanks.
try downgrade torchmetrics to torchmetrics==0.11.4
it work! thank you so much!
How do you downgrade tormetrics, I've tried: pip install torchmetrics==0.11.4 but, where do you put it? In venv in the webui rout folder? Where do you put it?
ImportError: cannot import name '_compare_version' from 'torchmetrics.utilities.imports’ I modify the source code of rich_progress.py and fix this error: In the venv/lib/python3.8/site-packages/pytorch_lightning/callbacks/progress/richprogress.py delete the '' of '_compare_version':
hey what if I simply don't have "compare_version" lines in rich_progress.py?
I very much want to +1 this. Removing the "_" in the instances on lines 20 and 26 fixed this error for me after a fresh download via the deployment package.
Edit: Actually, that only fixed half the issue. I now have another issue saying it can't add middleware, which seems to come from application.py on line 139? I'm not sure why that's returning as None, though, raising the exception. It should in theory be being set on line 121...
这是来自QQ邮箱的假期自动回复邮件。 您好,我最近正在休假中,无法亲自回复您的邮件。
for people running on google colab, once clean the runtime and add the torchmetrics==0.11.4 under pip install, then it would be working.
!pip install torchmetrics==0.11.4 torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchtext==0.14.1 torchaudio==0.13.1 torchdata==0.5.1 --extra-index-url https://download.pytorch.org/whl/cu117
it works, thanks!
这是来自QQ邮箱的假期自动回复邮件。 您好,我最近正在休假中,无法亲自回复您的邮件。
try downgrade torchmetrics to torchmetrics==0.11.4
thank you!the issue has been resolved. I performed the following actions: pip uninstall torchmetrics pip install torchmetrics==0.11.4
这是来自QQ邮箱的假期自动回复邮件。 您好,我最近正在休假中,无法亲自回复您的邮件。
Is there an existing issue for this?
What happened?
Use Google Colab and run into problems: cannot import name '_compare_version' from 'torchmetrics.utilities.imports'
Steps to reproduce the problem
What should have happened?
The Web-UI should have launched without any errors.
Version or Commit where the problem happens
11d432d
What Python version are you running on ?
None
What platforms do you use to access the UI ?
Windows
What device are you running WebUI on?
No response
Cross attention optimization
Automatic
What browsers do you use to access the UI ?
Google Chrome
Command Line Arguments
List of extensions
No
Console logs
Additional information
I don't know programming so don't know how to try to fix. I would like to keep using 11d432d if I could.