d8ahazard / sd_dreambooth_extension

Other
1.86k stars 282 forks source link

[Bug]: Exception training model: 'Error while serializing: IoError(Os { code: 1224, kind: Uncategorized, message: "请求的操作无法在使用用户映射区域打开的文件上执行。" })'. #1262

Closed NBE-1 closed 1 year ago

NBE-1 commented 1 year ago

Is there an existing issue for this?

What happened?

Cannot run due to the error. The latest vision has the problem.

Steps to reproduce the problem

Run after filling in the parameters

Commit and libraries

Initializing Dreambooth Dreambooth revision: b396af26b7906aa82a29d8847e756396cb2c28fb Successfully installed accelerate-0.19.0 fastapi-0.94.1 gitpython-3.1.31 transformers-4.29.2

Does your project take forever to startup? Repetitive dependency installation may be the reason. Automatic1111's base project sets strict requirements on outdated dependencies. If an extension is using a newer version, the dependency is uninstalled and reinstalled twice every startup.

[+] xformers version 0.0.17 installed. [+] torch version 2.0.1+cu118 installed. [+] torchvision version 0.15.2+cu118 installed. [+] accelerate version 0.19.0 installed. [+] diffusers version 0.16.1 installed. [+] transformers version 4.29.2 installed. [+] bitsandbytes version 0.35.4 installed.

Command Line Arguments

set COMMANDLINE_ARGS=--xformers --disable-nan-check --always-batch-cond-uncond --api  --theme dark --no-half-vae

Console logs

Initializing imagic training...
Initializing imagic.
E:\stable-diffusion-webui\venv\lib\site-packages\accelerate\accelerator.py:258: FutureWarning: `logging_dir` is deprecated and will be removed in version 0.18.0 of 🤗 Accelerate. Use `project_dir` instead.
  warnings.warn(
Optimizing embedding:   0%|                                                                    | 0/150 [00:00<?, ?it/s]Optimizing Embedding
Optimizing embedding: 100%|█| 150/150 [00:33<00:00,  4.47it/s, loss=tensor(0.0003, device='cuda:0', grad_fn=<DivBackwar
Saving embedding(s).
Fine Tuning:   0%|                                                                             | 0/150 [00:00<?, ?it/s]Fine Tuning
Fine Tuning: 100%|█████| 150/150 [00:34<00:00,  4.37it/s, loss=tensor(0.0001, device='cuda:0', grad_fn=<DivBackward0>)]
Saving pretrained model.
Traceback (most recent call last):
  File "E:\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\ui_functions.py", line 721, in start_training
    result = train_imagic(config)
  File "E:\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\train_imagic.py", line 343, in train_imagic
    pipeline.save_pretrained(args.pretrained_model_name_or_path, safe_serialization=True)
  File "E:\stable-diffusion-webui\venv\lib\site-packages\diffusers\pipelines\pipeline_utils.py", line 607, in save_pretrained
    save_method(os.path.join(save_directory, pipeline_component_name), **save_kwargs)
  File "E:\stable-diffusion-webui\venv\lib\site-packages\diffusers\models\modeling_utils.py", line 319, in save_pretrained
    safetensors.torch.save_file(
  File "E:\stable-diffusion-webui\venv\lib\site-packages\safetensors\torch.py", line 232, in save_file
    serialize_file(_flatten(tensors), filename, metadata=metadata)
safetensors_rust.SafetensorError: Error while serializing: IoError(Os { code: 1224, kind: Uncategorized, message: "请求 的操作无法在使用用户映射区域打开的文件上执行。" })
Restored system models.
Duration: 00:01:14

Additional information

No response

ddzbs commented 1 year ago

我也是这样

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 5 days with no activity. Remove stale label or comment or this will be closed in 5 days

skczhans commented 1 year ago

I also encountered such a problem, I don't know where I went wrong