开发者社区 > 大数据与机器学习 > 人工智能平台PAI > 正文

“AIGC Stable Diffusion文生图Lora模型微调实现虚拟上装”Lora微调训练问题

在执行Lora模型训练这一步的时候:执行如下命令,设置num_train_epochs为200,进行lora模型的训练:
! export MODEL_NAME="chilloutmix-ni" && \
export DATASET_NAME="cloth_train_example" && \
accelerate launch --mixed_precision="fp16" train_text_to_image_lora.py \
--pretrained_model_name_or_path=$MODEL_NAME \
--dataset_name=$DATASET_NAME --caption_column="text" \
--width=640 --height=768 --random_flip \
--train_batch_size=1 \
--num_train_epochs=200 --checkpointing_steps=5000 \
--learning_rate=1e-04 --lr_scheduler="constant" --lr_warmup_steps=0 \
--seed=42 \
--output_dir="cloth-model-lora" \
--validation_prompt="cloth1" --validation_epochs=100

出现问题:

╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /usr/local/lib/python3.10/dist-packages/diffusers/configuration_utils.py:337 │
│ in load_config │
│ │
│ 334 │ │ else: │
│ 335 │ │ │ try: │
│ 336 │ │ │ │ # Load from URL or cache if already cached │
│ ❱ 337 │ │ │ │ config_file = hf_hub_download( │
│ 338 │ │ │ │ │ pretrained_model_name_or_path, │
│ 339 │ │ │ │ │ filename=cls.config_name, │
│ 340 │ │ │ │ │ cache_dir=cache_dir, │
│ │
│ /usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_validators.py │
│ :120 in _inner_fn │
│ │
│ 117 │ │ if check_use_auth_token: │
│ 118 │ │ │ kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__na │
│ 119 │ │ │
│ ❱ 120 │ │ return fn(args, *kwargs) │
│ 121 │ │
│ 122 │ return _inner_fn # type: ignore │
│ 123 │
│ │
│ /usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py:125 │
│ 3 in hf_hub_download │
│ │
│ 1250 │ │ │ │ " and downloads online, set 'local_files_only' to Fal │
│ 1251 │ │ │ ) │
│ 1252 │ │ else: │
│ ❱ 1253 │ │ │ raise LocalEntryNotFoundError( │
│ 1254 │ │ │ │ "Connection error, and we cannot find the requested f │
│ 1255 │ │ │ │ " the disk cache. Please try again or make sure your │
│ 1256 │ │ │ │ " connection is on." │
╰──────────────────────────────────────────────────────────────────────────────╯
LocalEntryNotFoundError: Connection error, and we cannot find the requested
files in the disk cache. Please try again or make sure your Internet connection
is on.

During handling of the above exception, another exception occurred:

╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /mnt/workspace/train_text_to_image_lora.py:896 in │
│ │
│ 893 │
│ 894 │
│ 895 if name == "main": │
│ ❱ 896 │ main() │
│ 897 │
│ │
│ /mnt/workspace/train_text_to_image_lora.py:440 in main │
│ │
│ 437 │ │ │ os.makedirs(args.output_dir, exist_ok=True) │
│ 438 │ │
│ 439 │ # Load scheduler, tokenizer and models. │
│ ❱ 440 │ noise_scheduler = DDPMScheduler.from_pretrained(args.pretrained_mo │
│ 441 │ tokenizer = CLIPTokenizer.from_pretrained( │
│ 442 │ │ args.pretrained_model_name_or_path, subfolder="tokenizer", rev │
│ 443 │ ) │
│ │
│ /usr/local/lib/python3.10/dist-packages/diffusers/schedulers/scheduling_util │
│ s.py:139 in from_pretrained │
│ │
│ 136 │ │ │
│ 137 │ │ │
│ 138 │ │ """ │
│ ❱ 139 │ │ config, kwargs, commit_hash = cls.load_config( │
│ 140 │ │ │ pretrained_model_name_or_path=pretrained_model_name_or_pat │
│ 141 │ │ │ subfolder=subfolder, │
│ 142 │ │ │ return_unused_kwargs=True, │
│ │
│ /usr/local/lib/python3.10/dist-packages/diffusers/configuration_utils.py:364 │
│ in load_config │
│ │
│ 361 │ │ │ │ │ f" 'https://huggingface.co/{pretrained_model_name_
│ 362 │ │ │ │ ) │
│ 363 │ │ │ except EntryNotFoundError: │
│ ❱ 364 │ │ │ │ raise EnvironmentError( │
│ 365 │ │ │ │ │ f"{pretrained_model_name_or_path} does not appear │
│ 366 │ │ │ │ ) │
│ 367 │ │ │ except HTTPError as err: │
╰──────────────────────────────────────────────────────────────────────────────╯
OSError: chilloutmix-ni does not appear to have a file named
scheduler_config.json.
[02:18:28] ERROR failed (exitcode: 1) local_rank: 0 (pid: 502) of ]8;id=222292;file:///usr/local/lib/python3.10/dist-packages/torch/distributed/elastic/multiprocessing/api.py\api.py]8;;:]8;id=930720;file:///usr/local/lib/python3.10/dist-packages/torch/distributed/elastic/multiprocessing/api.py#673\673]8;;

binary: /usr/bin/python3

展开
收起
5rvcrq3dien7u 2023-12-22 11:09:29 105 0
1 条回答
写回答
取消 提交回答
  • 问题解决啦!我自己的问题,因为隔天重启实例,没有从第一步做起,直接接着做,所以一直重现昨天的错误。

    2023-12-22 13:01:17
    赞同 展开评论 打赏

相关电子书

更多
新一代AIGC图像应用 在零售行业的实践成果 立即下载
云原生场景下, AIGC模型服务的工程挑战和应对 立即下载
关于《探索AIGC下的软件工程新范式》的联合声明 立即下载