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

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

Closed
1 task done
angeloshredder opened this issue Apr 3, 2024 · 14 comments · Fixed by #6459
Closed
1 task done

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

angeloshredder opened this issue Apr 3, 2024 · 14 comments · Fixed by #6459
Labels
bug Something isn't working

Comments

@angeloshredder
Copy link

Is there an existing issue for this problem?

  • 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 angeloshredder added the bug Something isn't working label Apr 3, 2024
@psychedelicious
Copy link
Collaborator

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:

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.

@angeloshredder
Copy link
Author

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
Copy link
Author

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

@psychedelicious
Copy link
Collaborator

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
Copy link
Collaborator

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

@angeloshredder
Copy link
Author

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

@psychedelicious
Copy link
Collaborator

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?

@angeloshredder
Copy link
Author

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

@angeloshredder
Copy link
Author

installer log.txt

@angeloshredder
Copy link
Author

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

@angeloshredder
Copy link
Author

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

@the-space-fish
Copy link

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.

@angeloshredder
Copy link
Author

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

@psychedelicious
Copy link
Collaborator

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants