InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

[bug]: Upgrading to Invoke 4.0.1 Doesn't work as expected

Open angeloshredder opened this issue 1 year ago • 14 comments
trafficstars

Is there an existing issue for this problem?

  • [X] I have searched the existing issues

Operating system

Windows

GPU vendor

Nvidia (CUDA)

GPU model

RTX 3090

GPU VRAM

24

Version number

4.0.1

Browser

Google Chrome

Python dependencies

No response

What happened

I upgraded My InvokeAi to the last release 4.0.1 installer for the first time had some issues, but were fixed when in relaunched it the second time. ok

the first time i launched invoke.bat , i had errors related to costum nodes (this was expected since it's a major upgrade), so i made a backup of all of them, left my nodes folder empty. but when i restarted again ,

  1. Generate images with the browser-based interface console showed this error message : Starting the InvokeAI browser-based UI.. Traceback (most recent call last): File "C:\Users\USER\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in run_module_as_main return run_code(code, main_globals, None, File "C:\Users\USER\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in run_code exec(code, run_globals) File "C:\Users\USER\invokeai.venv\Scripts\invokeai-web.exe_main.py", line 7, in sys.exit(run_app()) File "C:\Users\USER\invokeai.venv\lib\site-packages\invokeai\app\run_app.py", line 10, in run_app from invokeai.app.api_app import invoke_api File "C:\Users\USER\invokeai.venv\lib\site-packages\invokeai\app\api_app.py", line 34, in from .api.dependencies import ApiDependencies File "C:\Users\USER\invokeai.venv\lib\site-packages\invokeai\app\api\dependencies.py", line 20, in from ..services.download import DownloadQueueService File "C:\Users\USER\invokeai.venv\lib\site-packages\invokeai\app\services\download_init.py", line 4, in from .download_default import DownloadQueueService, TqdmProgress File "C:\Users\USER\invokeai.venv\lib\site-packages\invokeai\app\services\download\download_default.py", line 18, in from invokeai.app.services.events.events_base import EventServiceBase File "C:\Users\USER\invokeai.venv\lib\site-packages\invokeai\app\services\events_init.py", line 1, in from .events_base import EventServiceBase # noqa F401 File "C:\Users\USER\invokeai.venv\lib\site-packages\invokeai\app\services\events\events_base.py", line 7, in from invokeai.app.services.session_queue.session_queue_common import ( File "C:\Users\USER\invokeai.venv\lib\site-packages\invokeai\app\services\session_queue\session_queue_common.py", line 10, in from invokeai.app.services.shared.graph import Graph, GraphExecutionState, NodeNotFoundError File "C:\Users\USER\invokeai.venv\lib\site-packages\invokeai\app\services\shared\graph.py", line 18, in from invokeai.app.invocations import * # noqa: F401 F403 File "C:\Users\USER\invokeai.venv\lib\site-packages\invokeai\app\invocations\controlnet_image_processors.py", line 9, in from controlnet_aux import ( ModuleNotFoundError: No module named 'controlnet_aux' Desired action:
  2. Generate images with the browser-based interface
  3. Open the developer console
  4. Run the InvokeAI image database maintenance script
  5. Command-line help Q - Quit

What you expected to happen

Normal behavior

How to reproduce the problem

No response

Additional context

No response

Discord username

angelotheshredder

angeloshredder avatar Apr 03 '24 00:04 angeloshredder

Thanks for making the separate issue.

The error message is saying that a required package didn't get installed. That's very much unexpected, because the installer always fully reinstalls missing packages.

Next steps:

  • Re-download the installer from here: https://github.com/invoke-ai/InvokeAI/releases/tag/v4.0.1
  • Delete the old installer before unzipping the new one (make sure no stale files are in there)
  • Run the installer again. Be sure this happens in a fresh cmd/powershell/terminal window.

I expect one of these outcomes:

  • No error messages and everything works.
  • The installer has some error message about being unable to install controlnet_aux. Please copy the full output from the installer if this happens.

psychedelicious avatar Apr 03 '24 01:04 psychedelicious

i did as you suggested but i get this error again : Please enter 1-4, Q: [1] 1 Starting the InvokeAI browser-based UI.. Traceback (most recent call last): File "C:\Users\USER\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in run_module_as_main return run_code(code, main_globals, None, File "C:\Users\USER\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in run_code exec(code, run_globals) File "C:\Users\USER\invokeai.venv\Scripts\invokeai-web.exe_main.py", line 7, in sys.exit(run_app()) File "C:\Users\USER\invokeai.venv\lib\site-packages\invokeai\app\run_app.py", line 10, in run_app from invokeai.app.api_app import invoke_api File "C:\Users\USER\invokeai.venv\lib\site-packages\invokeai\app\api_app.py", line 34, in from .api.dependencies import ApiDependencies File "C:\Users\USER\invokeai.venv\lib\site-packages\invokeai\app\api\dependencies.py", line 20, in from ..services.download import DownloadQueueService File "C:\Users\USER\invokeai.venv\lib\site-packages\invokeai\app\services\download_init.py", line 4, in from .download_default import DownloadQueueService, TqdmProgress File "C:\Users\USER\invokeai.venv\lib\site-packages\invokeai\app\services\download\download_default.py", line 18, in from invokeai.app.services.events.events_base import EventServiceBase File "C:\Users\USER\invokeai.venv\lib\site-packages\invokeai\app\services\events_init.py", line 1, in from .events_base import EventServiceBase # noqa F401 File "C:\Users\USER\invokeai.venv\lib\site-packages\invokeai\app\services\events\events_base.py", line 7, in from invokeai.app.services.session_queue.session_queue_common import ( File "C:\Users\USER\invokeai.venv\lib\site-packages\invokeai\app\services\session_queue\session_queue_common.py", line 10, in from invokeai.app.services.shared.graph import Graph, GraphExecutionState, NodeNotFoundError File "C:\Users\USER\invokeai.venv\lib\site-packages\invokeai\app\services\shared\graph.py", line 18, in from invokeai.app.invocations import * # noqa: F401 F403 File "C:\Users\USER\invokeai.venv\lib\site-packages\invokeai\app\invocations\controlnet_image_processors.py", line 9, in from controlnet_aux import ( ModuleNotFoundError: No module named 'controlnet_aux' Desired action:

  1. Generate images with the browser-based interface
  2. Open the developer console
  3. Run the InvokeAI image database maintenance script
  4. Command-line help Q - Quit

To update, download and run the installer from https://github.com/invoke-ai/InvokeAI/releases/latest.

angeloshredder avatar Apr 03 '24 01:04 angeloshredder

if i try : pip install controlnet_aux --force-reinstall --no-cache-dir this will work, but only in CPU , no GPU

angeloshredder avatar Apr 03 '24 01:04 angeloshredder

Thanks for trying, but I need to see the output from the installer to see what's wrong. Can you please copy everything the installer prints out?

psychedelicious avatar Apr 03 '24 02:04 psychedelicious

if i try : pip install controlnet_aux --force-reinstall --no-cache-dir this will work, but only in CPU , no GPU

Yeah, the error about controlnet_aux is not the root issue - I think you are somehow getting the wrong torch. That's why I need the full installer output

psychedelicious avatar Apr 03 '24 02:04 psychedelicious

using the console : i installed controlnet_aux via : pip install controlnet_aux --force-reinstall --no-cache-dir then after that : pip install --force-reinstall torch==2.2.1 --index-url https://download.pytorch.org/whl/cu121 it gives me this error : ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. invokeai 4.0.1 requires huggingface-hub==0.21.4, but you have huggingface-hub 0.22.2 which is incompatible. invokeai 4.0.1 requires requests~=2.28.2, but you have requests 2.31.0 which is incompatible. invokeai 4.0.1 requires scikit-image~=0.21.0, but you have scikit-image 0.22.0 which is incompatible. invokeai 4.0.1 requires timm==0.6.13, but you have timm 0.9.16 which is incompatible. invokeai 4.0.1 requires torchvision==0.17.1, but you have torchvision 0.17.2 which is incompatible. albumentations 1.4.3 requires typing-extensions>=4.9.0, but you have typing-extensions 4.8.0 which is incompatible. huggingface-hub 0.22.2 requires fsspec>=2023.5.0, but you have fsspec 2023.4.0 which is incompatible. torchvision 0.17.2 requires torch==2.2.2, but you have torch 2.2.1+cu121 which is incompatible.

but it's working now

angeloshredder avatar Apr 03 '24 02:04 angeloshredder

Ok, glad it's working. But you still haven't provided the full installer log output - it's much longer then that.

Also, you shouldn't have torchvision 0.17.2 installed. The installer doesn't even install that version. Do you have some shared virtual environment you are using?

psychedelicious avatar Apr 03 '24 03:04 psychedelicious

i didn't have full installer log output, i will delete the venv again, will reinstall again to reproduce the full error message

angeloshredder avatar Apr 03 '24 07:04 angeloshredder

and this log file is from starting invoke.bat invoke-bat log.txt

angeloshredder avatar Apr 03 '24 08:04 angeloshredder

Do you have some shared virtual environment you are using? A: i have lot of virtual environments in my PC ( ComfyUI, invokeAI Training, EveryDream2 training, kohya , etc .. ) but i make a special venv folder for every tools i install in my PC .. nothing is shared

angeloshredder avatar Apr 03 '24 08:04 angeloshredder

I'm still thinking there might be something funky with the controlnet-aux package. You can take a look at #5863 for how I resolved the same issue.

I wonder if in your case pip was also only installing the dist-info for controlnet-aux without the actual module contents.

the-space-fish avatar Apr 05 '24 00:04 the-space-fish

i reinstalled controlnet pip install controlnet_aux --force-reinstall --no-cache-dir this install command uninstalled torch and made somehow everything works in CPU, so i installed torch again

pip install --force-reinstall torch==2.2.1 --index-url https://download.pytorch.org/whl/cu121 also this works pip install --force-reinstall torch==2.2.2 --index-url https://download.pytorch.org/whl/cu121

with this done, I am ok, everything seems working as expected

angeloshredder avatar Apr 05 '24 00:04 angeloshredder

@angeloshredder Thanks for the logs and continued troubleshooting.

It's not clear why, but on some individual computers, the app ends up running with the CPU version of torch.

Your manual reinstalling is doing essentially the same thing as the installer, though we install more packages. We expect pip to install the same packages as what you got when you reinstalled torch and controlnet_aux manually.

Indeed, reviewing the install logs, I see we did get the same packages:

  • torch-2.2.1+cu121
  • controlnet-aux-0.0.7

So then, with these packages apparently successfully installed in your virtual environment, why is the application's python not getting them?

This is really puzzling. I wonder if maybe the wrong venv is being activated somehow. Could be related to the PATH env var or some other global configuration on the system I suppose, but I couldn't say what exactly.

@the-space-fish Thanks for sharing your solution. It's kinda silly that you had to do that to fix it, jeez.

psychedelicious avatar Apr 05 '24 03:04 psychedelicious