Skip to content

Textual Inversion got error of cannot find config.json file #579

@XavierXiao

Description

@XavierXiao

Describe the bug

When I follow every step described here, I got the following error:

OSError: CompVis/stable-diffusion-v1-4 does not appear to have a file named config.json.

I can use inference Pipeline with no issue. It should be related to token issue, as I can use the colab with notebook_login

Reproduction

python textual_inversion.py --pretrained_model_name_or_path=$MODEL_NAME --use_auth_token  --train_data_dir=$DATA_DIR  --learnable_property="object" --placeholder_token="<cat-toy>" --initializer_token="toy" --resolution=512 --train_batch_size=1 --gradient_accumulation_steps=4 --max_train_steps=3000 --learning_rate=5.0e-04 --scale_lr --lr_scheduler="constant" --lr_warmup_steps=0  --output_dir="textual_inversion_cat" 

Logs

Traceback (most recent call last):
  File "textual_inversion.py", line 587, in <module>
    main()
  File "textual_inversion.py", line 390, in main
    text_encoder = CLIPTextModel.from_pretrained(
  File "/home/yanq/.conda/envs/ldm/lib/python3.8/site-packages/transformers/modeling_utils.py", line 1764, in from_pretrained
    config, model_kwargs = cls.config_class.from_pretrained(
  File "/home/yanq/.conda/envs/ldm/lib/python3.8/site-packages/transformers/models/clip/configuration_clip.py", line 126, in from_pretrained
    config_dict, kwargs = cls.get_config_dict(pretrained_model_name_or_path, **kwargs)
  File "/home/yanq/.conda/envs/ldm/lib/python3.8/site-packages/transformers/configuration_utils.py", line 553, in get_config_dict
    config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, **kwargs)
  File "/home/yanq/.conda/envs/ldm/lib/python3.8/site-packages/transformers/configuration_utils.py", line 626, in _get_config_dict
    raise EnvironmentError(
OSError: CompVis/stable-diffusion-v1-4 does not appear to have a file named config.json.

System Info

  • diffusers version: 0.3.0
  • Platform: Linux-5.4.0-1054-aws-x86_64-with-glibc2.10
  • Python version: 3.8.5
  • PyTorch version (GPU?): 1.11.0 (True)
  • Huggingface_hub version: 0.9.1
  • Transformers version: 4.19.2
  • Using GPU in script?:
  • Using distributed or parallel set-up in script?:

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions