Textual Inversion got error of cannot find config.json file
See original GitHub issueDescribe 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?: <fill in>
- Using distributed or parallel set-up in script?: <fill in>
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Stable diffusion wont recognize my ui-config.json changes ...
I have edited the ui-config.json to set some default values so I dont need to constantly reset and reprogram SD with my common...
Read more >Not able to get the config json file - Stack Overflow
According to the module link you provided the config JSON ( default.json ) needs to be in a folder off root called "config"....
Read more >CompVis/stable-diffusion-v1-4 · Discussions - Hugging Face
Help with an error ... Need help with "Repository not found / make sure you are authenticated" ... Textual inversion: Are the imagenet...
Read more >Cyberpunk 2077 - PCGamingWiki PCGW
Much like previous CDPR titles, no version of the game requires either GOG Galaxy ... <path-to-game> \bin\x64\plugins\cyber_engine_tweaks\config.json file ...
Read more >picocli - a mighty tiny command line interface
By embedding these configuration files, your jar is instantly Graal-enabled. In most cases no further configuration is needed when generating a native image....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @XavierXiao , @Oragi ! IAs pointed out by @2132660698 if you upgrade transformers version. to
>=4.22.0
this should work. Because thesubfolder
argument isn’t available in previous versions. I will update the minimum version in example requirements.@FinnFrotscher It looks like you are using the compvis checkpoint, you should clone the diffusers checkpoint to use it with this library. https://huggingface.co/CompVis/stable-diffusion-v1-4
try this: pip install transformers==4.22.1