d8ahazard / sd_dreambooth_extension

Other
1.86k stars 283 forks source link

Creating a model fails #758

Closed PyroFD3S closed 1 year ago

PyroFD3S commented 1 year ago

Kindly read the entire form below and fill it out with the requested information.

Please find the following lines in the console and paste them below. If you do not provide this information, your issue will be automatically closed.

` Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] Commit hash: 3e20244b0fea10988cf5ad8a2fbe190ac47a5049 Installing requirements for Web UI Skipping dreambooth installation. Dreambooth revision is [+] 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.

Have you read the Readme? yes Have you completely restarted the stable-diffusion-webUI, not just reloaded the UI? yes 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 try to create a model get error, seems to create a few folders, clicking on train gives another error Exception training model: 'max() arg is an empty sequence'.

Provide logs Loading model from checkpoint. Loading checkpoint... v2 model loaded. Converting unet... Converting vae... Converting text encoder... Exception setting up output: Can't load tokenizer for 'stabilityai/stable-diffusion-2'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'stabilityai/stable-diffusion-2' is the correct path to a directory containing all relevant files for a CLIPTokenizer tokenizer. Traceback (most recent call last): File "E:\sd\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\sd_to_diff.py", line 935, in extract_checkpoint tokenizer = CLIPTokenizer.from_pretrained("stabilityai/stable-diffusion-2", subfolder="tokenizer") File "E:\sd\stable-diffusion-webui\venv\lib\site-packages\transformers\tokenization_utils_base.py", line 1785, in from_pretrained raise EnvironmentError( OSError: Can't load tokenizer for 'stabilityai/stable-diffusion-2'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'stabilityai/stable-diffusion-2' is the correct path to a directory containing all relevant files for a CLIPTokenizer tokenizer. Pipeline or config is not set, unable to continue. Can't load config! Traceback (most recent call last): File "E:\sd\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 321, in run_predict output = await app.blocks.process_api( File "E:\sd\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1016, in process_api data = self.postprocess_data(fn_index, result["prediction"], state) File "E:\sd\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 945, in postprocess_data if predictions[i] is components._Keywords.FINISHED_ITERATING: IndexError: tuple index out of range

If a crash has occurred, please provide the entire stack trace from the log, including the last few log messages before the crash occurred.

Environment

What OS? Windows 10

If Windows - WSL or native? Native

What GPU are you using? RTX 3080

Screenshots/Config { "attention": "xformers", "cache_latents": true, "center_crop": false, "clip_skip": 1, "concepts_path": "", "custom_model_name": "", "epoch": 0, "epoch_pause_frequency": 0.0, "epoch_pause_time": 60.0, "gradient_accumulation_steps": 1, "gradient_checkpointing": true, "gradient_set_to_none": true, "graph_smoothing": 50.0, "half_model": false, "hflip": false, "learning_rate": 2e-06, "learning_rate_min": 1e-06, "lora_learning_rate": 0.0002, "lora_model_name": "", "lora_txt_learning_rate": 0.0002, "lora_txt_weight": 1, "lora_weight": 1, "lr_cycles": 1, "lr_factor": 0.5, "lr_power": 1, "lr_scale_pos": 0.5, "lr_scheduler": "constant_with_warmup", "lr_warmup_steps": 0, "max_token_length": 75, "mixed_precision": "fp16", "model_dir": "E:\sd\stable-diffusion-webui\models\dreambooth\FabianDBphoto", "model_name": "FabianDBphoto", "num_train_epochs": 150, "pad_tokens": true, "pretrained_model_name_or_path": "E:\sd\stable-diffusion-webui\models\dreambooth\FabianDBphoto\working", "pretrained_vae_name_or_path": "", "prior_loss_weight": 1, "resolution": 512, "revision": 0, "sample_batch_size": 1, "sanity_prompt": "", "sanity_seed": 420420.0, "save_ckpt_after": true, "save_ckpt_cancel": false, "save_ckpt_during": false, "save_embedding_every": 0, "save_lora_after": true, "save_lora_cancel": false, "save_lora_during": false, "save_preview_every": 0, "save_state_after": false, "save_state_cancel": false, "save_state_during": false, "src": "E:\sd\stable-diffusion-webui\models\Stable-diffusion\768-v-ema.ckpt", "shuffle_tags": true, "train_batch_size": 1, "train_imagic": false, "stop_text_encoder": 1, "use_8bit_adam": true, "use_concepts": false, "use_ema": false, "use_lora": false, "use_subdir": true, "scheduler": "ddim", "v2": true, "has_ema": "False", "concepts_list": [ { "instance_data_dir": "E:\sd\FabianDBPhoto", "class_data_dir": "", "instance_prompt": "photo of fabianchung person", "class_prompt": "photo of person", "save_sample_prompt": "", "save_sample_template": "", "instance_token": "", "class_token": "", "num_class_images": 0, "num_class_images_per": 19, "class_negative_prompt": "", "class_guidance_scale": 7.5, "class_infer_steps": 40, "save_sample_negative_prompt": "", "n_save_sample": 1, "sample_seed": -1, "save_guidance_scale": 7.5, "save_infer_steps": 40 } ], "lifetime_revision": 0 }

PyroFD3S commented 1 year ago

PEBCAK

CJohnDesign commented 1 year ago

I am still having problems creating a model from the dreambooth extension.

Loading model from checkpoint.
Loading checkpoint...
Exception setting up output: Ran out of input
Traceback (most recent call last):
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd_dreambooth_extension/dreambooth/sd_to_diff.py", line 800, in extract_checkpoint
    checkpoint = torch.load(ckpt_path)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd_dreambooth_extension/reallysafe.py", line 117, in load
    return load_with_extra(filename, *args, **kwargs)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd_dreambooth_extension/reallysafe.py", line 164, in load_with_extra
    return unsafe_torch_load(filename, *args, **kwargs)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/safe.py", line 106, in load
    return load_with_extra(filename, extra_handler=global_extra_handler, *args, **kwargs)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/safe.py", line 151, in load_with_extra
    return unsafe_torch_load(filename, *args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/torch/serialization.py", line 795, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File "/usr/local/lib/python3.8/dist-packages/torch/serialization.py", line 1002, in _legacy_load
    magic_number = pickle_module.load(f, **pickle_load_args)
EOFError: Ran out of input
Pipeline or config is not set, unable to continue.