d8ahazard / sd_dreambooth_extension

Other
1.86k stars 282 forks source link

OSError: Error no file named diffusion_pytorch_model.bin found in directory C:\ai\stable-diffusion-webui\models\dreambooth\[name_of_model]\working. #1013

Closed gregoriofaerman closed 1 year ago

gregoriofaerman 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 revision: 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] Commit hash: 0cc0ee1bcb4c24a8c9715f66cede06601bfc00c8 Installing requirements for Web UI Skipping dreambooth installation. Dreambooth revision is 5075d4845243fac5607bc4cd448f86c64d6168df Diffusers version is *0.14.0* Torch version is 1.13.1+cu117 Torch vision version 0.14.1+cu117

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

I am training a model on pictures of my faceWhen I start to train my model it charges and gives the following error:

_OSError: Error no file named diffusion_pytorch_model.bin found in directory C:\ai\stable-diffusion-webui\models\dreambooth[name_ofmodel]\working.

(A clear and concise description of what the bug is)

Provide logs

Model dir set to: C:\ai\stable-diffusion-webui\models\dreambooth\olapikachu123
Model dir set to: C:\ai\stable-diffusion-webui\models\dreambooth\olapikachu123
Initializing dreambooth training...
Change in precision detected, please restart the webUI entirely to use new precision.
Restored system models.
Model dir set to: C:\ai\stable-diffusion-webui\models\dreambooth\olapikachu123
Model dir set to: C:\ai\stable-diffusion-webui\models\dreambooth\olapikachu123
Initializing dreambooth training...
Pre-processing images: person: : 0it [00:00, ?it/s]                                                                                                                                                                                         We need a total of 80 class images.
Pre-processing images: person: : 0it [00:00, ?it/s]
Generating 80 class images for training...
Generating class images 0/80::   0%|                                                                                                                                                                                 | 0/80 [00:00<?, ?it/s]Traceback (most recent call last):
  File "C:\ai\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\ui_functions.py", line 657, in start_training
    result = main(use_txt2img=use_txt2img)
  File "C:\ai\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\train_dreambooth.py", line 1140, in main
    return inner_loop()
  File "C:\ai\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\memory.py", line 123, in decorator
    return function(batch_size, grad_size, prof, *args, **kwargs)
  File "C:\ai\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\train_dreambooth.py", line 198, in inner_loop
    count, instance_prompts, class_prompts = generate_classifiers(args, use_txt2img=use_txt2img,
  File "C:\ai\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\utils\gen_utils.py", line 134, in generate_classifiers
    builder = ImageBuilder(
  File "C:\ai\stable-diffusion-webui\extensions\sd_dreambooth_extension\helpers\image_builder.py", line 96, in __init__
    vae=AutoencoderKL.from_pretrained(
  File "C:\ai\stable-diffusion-webui\venv\lib\site-packages\diffusers\models\modeling_utils.py", line 527, in from_pretrained
    model_file = _get_model_file(
  File "C:\ai\stable-diffusion-webui\venv\lib\site-packages\diffusers\models\modeling_utils.py", line 821, in _get_model_file
    raise EnvironmentError(
OSError: Error no file named diffusion_pytorch_model.bin found in directory C:\ai\stable-diffusion-webui\models\dreambooth\olapikachu123\working.
Generating class images 0/80::   0%|                                                                                                                                                                                 | 0/80 [00:00<?, ?it/s]
Restored system models.

Environment

What OS? W10 Home, Version 10.0.19044 Build 19044

If Windows - WSL or native? i understand that I have native

What GPU are you using? NVIDIA GeForce GTX 1660

Screenshots/Config

error log

If the issue is specific to an error while training, please provide a screenshot of training parameters or the db_config.json file from /models/dreambooth/MODELNAME/db_config.json { "adamw_weight_decay": 0.01, "attention": "default", "cache_latents": true, "clip_skip": 1, "concepts_list": [ { "class_data_dir": "F:\\ia-content\\REGULARIZATION-IMAGES-SD\\person", "class_guidance_scale": 7.5, "class_infer_steps": 40, "class_negative_prompt": "", "class_prompt": "photo of a person", "class_token": "", "instance_data_dir": "F:\\ia-content\\gregito", "instance_prompt": "photo of gregito person", "instance_token": "", "is_valid": true, "n_save_sample": 1, "num_class_images_per": 5, "sample_seed": -1, "save_guidance_scale": 7.5, "save_infer_steps": 20, "save_sample_negative_prompt": "", "save_sample_prompt": "", "save_sample_template": "" } ], "concepts_path": "", "custom_model_name": "", "deis_train_scheduler": false, "deterministic": false, "ema_predict": false, "epoch": 0, "epoch_pause_frequency": 100, "epoch_pause_time": 1200, "freeze_clip_normalization": false, "gradient_accumulation_steps": 1, "gradient_checkpointing": true, "gradient_set_to_none": true, "graph_smoothing": 50, "half_lora": false, "half_model": false, "train_unfrozen": false, "has_ema": false, "hflip": false, "infer_ema": false, "initial_revision": 0, "learning_rate": 1e-06, "learning_rate_min": 1e-06, "lifetime_revision": 0, "lora_learning_rate": 0.0002, "lora_model_name": "olapikachu123_0.pt", "lora_unet_rank": 4, "lora_txt_rank": 4, "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": "no", "model_name": "olapikachu123", "model_dir": "C:\\ai\\stable-diffusion-webui\\models\\dreambooth\\olapikachu123", "model_path": "C:\\ai\\stable-diffusion-webui\\models\\dreambooth\\olapikachu123", "num_train_epochs": 1000, "offset_noise": 0, "optimizer": "8Bit Adam", "pad_tokens": true, "pretrained_model_name_or_path": "C:\\ai\\stable-diffusion-webui\\models\\dreambooth\\olapikachu123\\working", "pretrained_vae_name_or_path": "", "prior_loss_scale": false, "prior_loss_target": 100.0, "prior_loss_weight": 0.75, "prior_loss_weight_min": 0.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_ema": true, "save_embedding_every": 1000, "save_lora_after": true, "save_lora_cancel": false, "save_lora_during": false, "save_preview_every": 1000, "save_safetensors": true, "save_state_after": false, "save_state_cancel": false, "save_state_during": false, "scheduler": "DEISMultistep", "shuffle_tags": true, "snapshot": "", "split_loss": true, "src": "C:\\ai\\stable-diffusion-webui\\models\\Stable-diffusion\\v1-5-pruned.ckpt", "stop_text_encoder": 1, "strict_tokens": false, "tf32_enable": false, "train_batch_size": 1, "train_imagic": false, "train_unet": true, "use_concepts": false, "use_ema": false, "use_lora": false, "use_lora_extended": false, "use_subdir": true, "v2": false }

ArrowM commented 1 year ago

diffusion_pytorch_model.bin is the unet that gets extracted from the source model, it looks like yours in missing. Please try creating your db model again and see if that fixes it.

BafS commented 1 year ago

I have the same issue, I tried to re-create the model again but it didn't change. As a workaround I downloaded the needed files from https://huggingface.co/stabilityai/stable-diffusion-2-1/tree/main/vae and moved them manually in the correct folder.

BafS commented 1 year ago

It seems that I only have this issue when my "Source checkpoint" is a .ckpt, it works fine with .safetensors.

AlexTan08 commented 2 months ago

I am trying to train an SDXL model, and when it creates a working\unet directory it makes 3 files: diffusion_pytorch_model.bin.index.json diffusion_pytorch_model-00001-of-00002.bin diffusion_pytorch_model-00002-of-00002.bin

The error is then the same as above: Error no file named diffusion_pytorch_model.bin found in directory Z:\sd\stable-diffusion-webui\models\dreambooth\Test5\working and Error no file named diffusion_pytorch_model.bin found in directory Z:\sd\stable-diffusion-webui\models\dreambooth\Test5\working\unet

Looks like something doesn't understand split/chained bins? What do I have to update to make it understand those?

rutvithakkar2002 commented 1 month ago

OSError: Error no file named pytorch_lora_weights.safetensors found in directory shubh20240827115248. how to solve the error!?

paulhaskett commented 1 month ago

same error here, any fix yet?

yuanzhi-zhu commented 3 weeks ago

I am trying to train an SDXL model, and when it creates a working\unet directory it makes 3 files: diffusion_pytorch_model.bin.index.json diffusion_pytorch_model-00001-of-00002.bin diffusion_pytorch_model-00002-of-00002.bin

The error is then the same as above: Error no file named diffusion_pytorch_model.bin found in directory Z:\sd\stable-diffusion-webui\models\dreambooth\Test5\working and Error no file named diffusion_pytorch_model.bin found in directory Z:\sd\stable-diffusion-webui\models\dreambooth\Test5\working\unet

Looks like something doesn't understand split/chained bins? What do I have to update to make it understand those?

@AlexTan08 Try this https://github.com/huggingface/diffusers/issues/8805#issuecomment-2213045694