How does one use this, I'm totally lost and am receiving only errors from the example python code

#51
by trapbuilder2 - opened

I've been struggling to figure out how to actually utilise all this hard work for several hours now. I thought myself quite good at following instructions, but I'm having a difficult time discerning if there even are any instructions. I've cloned sd-v1-4.ckpt, but I've no idea what I'm supposed to do with it, I've connected my HF hub token and I've ran the example python code and received nothing but errors.

Are you using the diffusers or the original codebase? What errors are you getting?

Diffusers, at least that's what I spent hours installing through the CMD (my whole python installation was borked, I had to reinstall it several times to get pip to work). I'll be honest, this whole thing seems labyrinthine to me, but it might just be covid brain. I'll come back to it when I'm better and hopefully I'll understand it more.

Anyway, I re-ran the file to get the errors but now it's giving me different errors.

ftfy or spacy is not installed using BERT BasicTokenizer instead of ftfy.
{'trained_betas'} was not found in config. Values will be initialized to default values.
Traceback (most recent call last):
File "D:\Stable Diffusion\First Test.py", line 10, in
pipe = pipe.to(device)
File "C:\Users[redacted]\AppData\Local\Programs\Python\Python310\lib\site-packages\diffusers\pipeline_utils.py", line 168, in to
module.to(torch_device)
File "C:\Users[redacted]\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 927, in to
return self._apply(convert)
File "C:\Users[redacted]\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 579, in _apply
module._apply(fn)
File "C:\Users[redacted]\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 579, in _apply
module._apply(fn)
File "C:\Users[redacted]\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 602, in apply
param_applied = fn(param)
File "C:\Users[redacted]\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 925, in convert
return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
File "C:\Users[redacted]\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\cuda_init
.py", line 211, in _lazy_init
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled

It didn't use to be this error, and the program used to actually show some kind of progress bar before errorring, so I'm not sure what's changed, but like I said I think I'll just have to come back to it with a clearer head

I'm a beginner as well but it looks like some dependencies are not configured properly. I would try uninstalling and reinstalling ftfy, spacy, and torch (with CUDA) using pip. Also clear the pip cache so the installations are fresh (!pip cache purge). These versions worked for me with the original model, worth trying with Diffusers:
!pip install ftfy==6.1.1
!pip install spacy==3.2.1
!pip install torch==1.11.0 torchvision==0.12.0 -f https://download.pytorch.org/whl/cu113/torch_stable.html

Good luck!

Hey @trapbuilder2 ,

It indeed seems like a Python PyTorch bug.

Sign up or log in to comment