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

Error while trying to generate from dream.py #16

Closed
andrige opened this issue Aug 21, 2022 · 3 comments
Closed

Error while trying to generate from dream.py #16

andrige opened this issue Aug 21, 2022 · 3 comments

Comments

@andrige
Copy link

andrige commented Aug 21, 2022

Hey, followed your Windows guide but got stuck at this step and error.
I've tried using both dream.py -l and dream.py to refer to pre- and post-release models that I found.

(base) C:\Users\andrige>cd stable-diffusion

(base) C:\Users\andrige\stable-diffusion>conda activate ldm

(ldm) C:\Users\andrige\stable-diffusion>python scripts\preload_models.py
preloading bert tokenizer...
...success
preloading Kornia requirements...
...success

(ldm) C:\Users\andrige\stable-diffusion>python scripts\dream.py
* Initializing, be patient...


* Initialization done! Awaiting your command (-h for help, q to quit)...
dream> ashley judd riding a camel -n2 -s150
Loading model from models/ldm/stable-diffusion-v1/model.ckpt
Global Step: 440000
Traceback (most recent call last):
  File "scripts\dream.py", line 278, in <module>
    main()
  File "scripts\dream.py", line 69, in main
    main_loop(t2i,cmd_parser,log)
  File "scripts\dream.py", line 116, in main_loop
    results = t2i.txt2img(**vars(opt))
  File "c:\users\andrige\stable-diffusion\ldm\simplet2i.py", line 154, in txt2img
    model = self.load_model()  # will instantiate the model or return it from cache
  File "c:\users\andrige\stable-diffusion\ldm\simplet2i.py", line 379, in load_model
    model = self._load_model_from_config(config,self.weights)
  File "c:\users\andrige\stable-diffusion\ldm\simplet2i.py", line 402, in _load_model_from_config
    model = instantiate_from_config(config.model)
  File "c:\users\andrige\stable-diffusion\ldm\util.py", line 83, in instantiate_from_config
    return get_obj_from_str(config["target"])(**config.get("params", dict()))
  File "c:\users\andrige\stable-diffusion\ldm\util.py", line 91, in get_obj_from_str
    return getattr(importlib.import_module(module, package=None), cls)
  File "G:\ai\Miniconda3\envs\ldm\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "c:\users\andrige\stable-diffusion\ldm\models\diffusion\ddpm.py", line 25, in <module>
    from ldm.models.autoencoder import VQModelInterface, IdentityFirstStage, AutoencoderKL
  File "c:\users\andrige\stable-diffusion\ldm\models\autoencoder.py", line 6, in <module>
    from taming.modules.vqvae.quantize import VectorQuantizer2 as VectorQuantizer
ModuleNotFoundError: No module named 'taming'

Conda info for current version etc.

(ldm) C:\Users\andrige\stable-diffusion>conda info

     active environment : ldm
    active env location : G:\ai\Miniconda3\envs\ldm
            shell level : 2
       user config file : C:\Users\andrige\.condarc
 populated config files : C:\Users\andrige\.condarc
          conda version : 4.13.0
    conda-build version : not installed
         python version : 3.9.12.final.0
       virtual packages : __cuda=11.7=0
                          __win=0=0
                          __archspec=1=x86_64
       base environment : G:\ai\Miniconda3  (writable)
      conda av data dir : G:\ai\Miniconda3\etc\conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : G:\ai\Miniconda3\pkgs
                          C:\Users\andrige\.conda\pkgs
                          C:\Users\andrige\AppData\Local\conda\conda\pkgs
       envs directories : G:\ai\Miniconda3\envs
                          C:\Users\andrige\.conda\envs
                          C:\Users\andrige\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.13.0 requests/2.28.1 CPython/3.9.12 Windows/10 Windows/10.0.19044
          administrator : False
             netrc file : None
           offline mode : False

Paths to the model.ckpt's I have downloaded are:
C:\Users\Andrige\stable-diffusion\models\ldm\text2img-large\model.ckpt - from your guide
C:\Users\Andrige\stable-diffusion\models\ldm\stable-diffusion-v1\model.ckpt - from the other guide in this Reddit post

@dannyraede
Copy link

Had all sorts of issues like this. Instructions say to download the latest version of python, but you actually need to download python 3.8.5

@andrige
Copy link
Author

andrige commented Aug 21, 2022

Had all sorts of issues like this. Instructions say to download the latest version of python, but you actually need to download python 3.8.5

That did the trick! Thank you!
The guide definitely could use that crucial bit of information.

@lstein
Copy link
Collaborator

lstein commented Aug 22, 2022

Thanks. I'll fix the instructions.

@lstein lstein closed this as completed Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants