InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

[bug]: Error on executing invoke.py script

Open danishka opened this issue 3 years ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

OS

Linux

GPU

amd

VRAM

No response

What happened?

I have done manual installation up to python scripts/preload_models.py.

[ivory@vm33 stable-diffusion]$ conda activate invokeai
(invokeai) [ivory@vm33 stable-diffusion]$ conda activate ldm

EnvironmentNameNotFound: Could not find conda environment: ldm
You can list all discoverable environments with `conda info --envs`.


(invokeai) [ivory@vm33 stable-diffusion]$ conda info --envs
# conda environments:
#
base                     /home/ivory/anaconda3
invokeai              *  /home/ivory/anaconda3/envs/invokeai

(invokeai) [ivory@vm33 stable-diffusion]$ python scripts/preload_models.py 
Loading Python libraries...
.
.
Downloading preprocessor_config.json: 100%|█| 342/342 [00:00<00:0
StableDiffusionSafetyChecker...
Downloading config.json: 100%|█| 4.44k/4.44k [00:00<00:00, 5.68MB
Downloading pytorch_model.bin: 100%|█| 1.13G/1.13G [00:13<00:00, 
...success

** Model Installation Successful **
You're all set! You may now launch InvokeAI using one of these two commands:
Web version: 
    python scripts/invoke.py --web  (connect to http://localhost:9090)
Command-line version:
   python scripts/invoke.py

I have tryied both python scripts/invoke.py and python scripts/invoke.py --web but both approaches were failed with error.

(invokeai) [ivory@vm33 stable-diffusion]$ python scripts/invoke.py 
* Initializing, be patient...
>> Initialization file /home/ivory/.invokeai found. Loading...
>> InvokeAI runtime directory is "/home/ivory/invokeai"
Traceback (most recent call last):
  File "/home/ivory/stable-diffusion/scripts/invoke.py", line 4, in <module>
    ldm.invoke.CLI.main()
  File "/home/ivory/stable-diffusion/ldm/invoke/CLI.py", line 54, in main
    from ldm.generate import Generate
  File "/home/ivory/stable-diffusion/ldm/generate.py", line 19, in <module>
    import cv2
  File "/home/ivory/anaconda3/envs/invokeai/lib/python3.9/site-packages/cv2/__init__.py", line 8, in <module>
    from .cv2 import *
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
(invokeai) [ivory@vm33 stable-diffusion]$ 
(invokeai) [ivory@vm33 stable-diffusion]$ python scripts/invoke.py --web
* Initializing, be patient...
>> Initialization file /home/ivory/.invokeai found. Loading...
>> InvokeAI runtime directory is "/home/ivory/invokeai"
Traceback (most recent call last):
  File "/home/ivory/stable-diffusion/scripts/invoke.py", line 4, in <module>
    ldm.invoke.CLI.main()
  File "/home/ivory/stable-diffusion/ldm/invoke/CLI.py", line 54, in main
    from ldm.generate import Generate
  File "/home/ivory/stable-diffusion/ldm/generate.py", line 19, in <module>
    import cv2
  File "/home/ivory/anaconda3/envs/invokeai/lib/python3.9/site-packages/cv2/__init__.py", line 8, in <module>
    from .cv2 import *
ImportError: libGL.so.1: cannot open shared object file: No such file or directory

Am I missing something in my deployment?

Screenshots

No response

Additional context

I have used following enviroment after copying the enviroment file to root directory (/home/ivory/stable-diffusion). conda env create -f environment-lin-amd.yml

Contact Details

No response

danishka avatar Dec 03 '22 02:12 danishka

run "sudo apt install -y libgl1-mesa-glx libglib2.0-0" in cli and then try running invoke.py again

mickr777 avatar Dec 03 '22 02:12 mickr777