d8ahazard / sd_dreambooth_extension

Other
1.87k stars 284 forks source link

Pipeline or config is not set, unable to continue. #429

Closed patrickmros closed 1 year ago

patrickmros commented 1 year ago

Kindly read this ENTIRE form and fill it out with the requested information. It may seem tedious, but it's even more tedious asking basic questions to ensure I'm not trying to troubleshoot a bug I've already fixed. Help me help you, answer all the questions and follow the steps below before posting.

` Python revision: 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] Dreambooth revision: 47cce57fe84f318eba85a1b8c0d9908f0643f1eb and 88cc50ace470580842b519115545b9a08ebe115e SD-WebUI revision: 44c46f0ed395967cd3830dd481a2db759fda5b3b

Checking Dreambooth requirements... [+] bitsandbytes version 0.35.0 installed. [+] diffusers[torch] version 0.10.0.dev0 installed. [+] transformers version 4.21.0 installed. [ ] xformers version 0.0.14.dev0 installed. [ ] torch version 1.12.1+cu116 installed. [ ] torchvision version 0.13.1+cu116 installed. `

Have you read the Readme?

yes

Have you completely restarted the stable-diffusion-webUI, not just reloaded the UI?

yes (many times)

Have you updated Dreambooth to the latest revision?

yes

Have you updated the Stable-Diffusion-WebUI to the latest version?

yes

No, really. Please save us both some trouble and update the SD-WebUI and Extension and restart before posting this. Reply 'OK' Below to acknowledge that you did this.

OK

Describe the bug

Had problems using a self-mixed model with dreambooth. After an update yesterday it worked. Something about state_dict and checkpoint not found. I remember the phrase "Trying something else". Trained a model over night. After the newest update today i have problems with that model again. Looks like the same error with slightly different error message. "Trying something else" is missing now. Maybe "something else" should be used? ;-)

Provide logs

Loading model from checkpoint. Loading checkpoint... Pipeline or config is not set, unable to continue. Exception while extracting model: 'state_dict' Error completing request Arguments: ('test', "mix_model1.ckpt [c19ca25b]", 'ddim', False, '', '', False) {} Traceback (most recent call last): File "J:\sd_06_10_2022\stable-diffusion-webui\modules\call_queue.py", line 45, in f res = list(func(*args, *kwargs)) File "J:\sd_06_10_2022\stable-diffusion-webui\modules\call_queue.py", line 28, in f res = func(args, **kwargs) File "J:\sd_06_10_2022\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\sd_to_diff.py", line 962, in extract_checkpoint db_config.resolution, \ AttributeError: 'NoneType' object has no attribute 'resolution'

Traceback (most recent call last): File "J:\sd_06_10_2022\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 284, in run_predict output = await app.blocks.process_api( File "J:\sd_06_10_2022\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 983, in process_api data = self.postprocess_data(fn_index, result["prediction"], state) File "J:\sd_06_10_2022\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 913, in postprocess_data if predictions[i] is components._Keywords.FINISHED_ITERATING: IndexError: tuple index out of range

Environment

What OS?

Windows - native

What GPU are you using?

RTX 3060 12 GB VRAM

Screenshots/Config

Lunmingpei commented 1 year ago

I met the same bug today. I tried to create a new model using NovelAI (animefull-latest.ckpt).

Loading model from checkpoint. Loading checkpoint... Pipeline or config is not set, unable to continue. Restored system models. Allocated: 10.8GB Reserved: 11.0GB

Allocated 10.8/10.8GB Reserved: 11.0/11.0GB

Exception while extracting model: 'state_dict' Error completing request Arguments: ('test', 'animefull-latest.ckpt [e6e8e1fc]', 'ddim', False, '', '', True) {} Traceback (most recent call last): File "E:\stable-diffusion-webui (2)\modules\call_queue.py", line 45, in f res = list(func(*args, *kwargs)) File "E:\stable-diffusion-webui (2)\modules\call_queue.py", line 28, in f res = func(args, **kwargs) File "E:\stable-diffusion-webui (2)\extensions\sd_dreambooth_extension\dreambooth\sd_to_diff.py", line 962, in extract_checkpoint db_config.resolution, \ AttributeError: 'NoneType' object has no attribute 'resolution'

Traceback (most recent call last): File "E:\stable-diffusion-webui (2)\venv\lib\site-packages\gradio\routes.py", line 284, in run_predict output = await app.blocks.process_api( File "E:\stable-diffusion-webui (2)\venv\lib\site-packages\gradio\blocks.py", line 983, in process_api data = self.postprocess_data(fn_index, result["prediction"], state) File "E:\stable-diffusion-webui (2)\venv\lib\site-packages\gradio\blocks.py", line 913, in postprocess_data if predictions[i] is components._Keywords.FINISHED_ITERATING: IndexError: tuple index out of range Allocated 3.6/10.8GB Reserved: 11.0/11.0GB

Stardust-SJF commented 1 year ago

The same problem on V100 machine with Ubuntu 20.04, waiting for solutions. I remember that when creating models from the same checkpoint file with previous version of sd_db_extention, it will show the logs like "state_dict not found. try to find it somewhere...."

Stardust-SJF commented 1 year ago

I've found a similar issue here: https://github.com/d8ahazard/sd_dreambooth_extension/issues/9, which maybe helpful.

patrickmros commented 1 year ago

I've found a similar issue here: #9, which maybe helpful.

This should have been fixed with https://github.com/d8ahazard/sd_dreambooth_extension/commit/a9bbe70f7cf3edf8b4b8281e2ecc2960fa07648d and i think it was. As I mentioned it above: it wasn't working, then it worked and now it's not working again. It always has something to do with state_dict not found.

Edit: I just checked the conversion.py and it doesn't even exist anymore.

Stardust-SJF commented 1 year ago

I've found a similar issue here: #9, which maybe helpful.

This should have been fixed with a9bbe70 and i think it was. As I mentioned it above: it wasn't working, then it worked and now it's not working again. It always has something to do with state_dict not found.

Edit: I just checked the conversion.py and it doesn't even exist anymore.

I've done a quick fix on my fork: https://github.com/Stardust-SJF/sd_dreambooth_extension/commit/553656dcdf1a4defe1165e164496901be82bfa46. You can have a try.

patrickmros commented 1 year ago

@Stardust-SJF Stardust-SJF solution is working fine for me! Maybe @d8ahazard can have a look at this?

d8ahazard commented 1 year ago

I'm aware of the issue, and have a fix implemented in the v21 branch. Will merge in the next day or so.

NivaucchuRabuessa commented 1 year ago

Same issue. Fork doesn't fix it. RTX3080 10GB, Windows11. Same source checkpoint as #6.

Python revision: 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Dreambooth revision: 82f7c9e3d85be3ea8c32334dd7efbba740279f51
SD-WebUI revision: 44c46f0ed395967cd3830dd481a2db759fda5b3b

Checking Dreambooth requirements...
[+] bitsandbytes version 0.35.0 installed.
[+] diffusers version 0.10.2 installed.
[+] transformers version 4.25.1 installed.
[+] xformers version 0.0.14.dev0 installed.
[+] torch version 1.12.1+cu113 installed.
[+] torchvision version 0.13.1+cu113 installed.

Loading model from checkpoint.
Loading checkpoint...
v1 model loaded.
Creating scheduler...
Converting unet...
Converting vae...
Converting text encoder...
Pipeline or config is not set, unable to continue.
 Restored system models.

Exception while extracting model: Error(s) in loading state_dict for CLIPTextModel: [...]
Unexpected key(s) in state_dict: [...]
Stardust-SJF commented 1 year ago

Same issue. Fork doesn't fix it. RTX3080 10GB, Windows11. Same source checkpoint as #6.

Python revision: 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Dreambooth revision: 82f7c9e3d85be3ea8c32334dd7efbba740279f51
SD-WebUI revision: 44c46f0ed395967cd3830dd481a2db759fda5b3b

Checking Dreambooth requirements...
[+] bitsandbytes version 0.35.0 installed.
[+] diffusers version 0.10.2 installed.
[+] transformers version 4.25.1 installed.
[+] xformers version 0.0.14.dev0 installed.
[+] torch version 1.12.1+cu113 installed.
[+] torchvision version 0.13.1+cu113 installed.

Loading model from checkpoint.
Loading checkpoint...
v1 model loaded.
Creating scheduler...
Converting unet...
Converting vae...
Converting text encoder...
Pipeline or config is not set, unable to continue.
 Restored system models.

Exception while extracting model: Error(s) in loading state_dict for CLIPTextModel: [...]
Unexpected key(s) in state_dict: [...]

Maybe you can have a look at https://github.com/Stardust-SJF/sd_dreambooth_extension/commit/b70d5705c32a35ee17892d6125272b477bf379c0. I fixed this problem on the latest commit and tested on my server.

NivaucchuRabuessa commented 1 year ago

Maybe you can have a look at Stardust-SJF@b70d570. I fixed this problem on the latest commit and tested on my server.

This fix worked! Thank you very much.

d8ahazard commented 1 year ago

Fixed with e124b0d. Thanks to @Stardust-SJF for the patch.