I cannot find config.json and pytorch_model.bin,how to fix it

#143
by lsx314159 - opened

The config attributes {'add_watermarker': None} were passed to StableDiffusionXLPipeline, but are not expected and will be ignored. Please verify your model_index.json configuration file.
Keyword arguments {'add_watermarker': None} are not expected by StableDiffusionXLPipeline and will be ignored.
The config attributes {'force_upcast': True} were passed to AutoencoderKL, but are not expected and will be ignored. Please verify your config.json configuration file.
Traceback (most recent call last):
File "D:\Codes\thesis00\process_data\stable_diffusion_x1_base_1.0.py", line 12, in
pipe = DiffusionPipeline.from_pretrained("../../../Pretraining_model/stable-diffusion-xl-base_1.0",
File "C:\Users\lsx.conda\envs\lsx00\lib\site-packages\diffusers\pipelines\pipeline_utils.py", line 1037, in from_pretrained
loaded_sub_model = load_sub_model(
File "C:\Users\lsx.conda\envs\lsx00\lib\site-packages\diffusers\pipelines\pipeline_utils.py", line 453, in load_sub_model
loaded_sub_model = load_method(cached_folder, **loading_kwargs)
File "C:\Users\lsx.conda\envs\lsx00\lib\site-packages\transformers\modeling_utils.py", line 2325, in from_pretrained
config, model_kwargs = cls.config_class.from_pretrained(
File "C:\Users\lsx.conda\envs\lsx00\lib\site-packages\transformers\models\clip\configuration_clip.py", line 134, in from_pretrained
config_dict, kwargs = cls.get_config_dict(pretrained_model_name_or_path, **kwargs)
File "C:\Users\lsx.conda\envs\lsx00\lib\site-packages\transformers\configuration_utils.py", line 617, in get_config_dict
config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, **kwargs)
File "C:\Users\lsx.conda\envs\lsx00\lib\site-packages\transformers\configuration_utils.py", line 672, in _get_config_dict
resolved_config_file = cached_file(
File "C:\Users\lsx.conda\envs\lsx00\lib\site-packages\transformers\utils\hub.py", line 388, in cached_file
raise EnvironmentError(
OSError: ../../../Pretraining_model/stable-diffusion-xl-base_1.0 does not appear to have a file named config.json. Checkout 'https://huggingface.co/../../../Pretraining_model/stable-diffusion-xl-base_1.0/main' for available files.
The config attributes {'add_watermarker': None} were passed to StableDiffusionXLPipeline, but are not expected and will be ignored. Please verify your model_index.json configuration file.
Keyword arguments {'add_watermarker': None} are not expected by StableDiffusionXLPipeline and will be ignored.
The config attributes {'force_upcast': True} were passed to AutoencoderKL, but are not expected and will be ignored. Please verify your config.json configuration file.

I meet the first problem, then I create a config.json but then I meet a new problem below:

Traceback (most recent call last):
File "D:\Codes\thesis00\process_data\stable_diffusion_x1_base_1.0.py", line 12, in
pipe = DiffusionPipeline.from_pretrained("../../../Pretraining_model/stable-diffusion-xl-base_1.0",
File "C:\Users\lsx.conda\envs\lsx00\lib\site-packages\diffusers\pipelines\pipeline_utils.py", line 1037, in from_pretrained
loaded_sub_model = load_sub_model(
File "C:\Users\lsx.conda\envs\lsx00\lib\site-packages\diffusers\pipelines\pipeline_utils.py", line 453, in load_sub_model
loaded_sub_model = load_method(cached_folder, **loading_kwargs)
File "C:\Users\lsx.conda\envs\lsx00\lib\site-packages\transformers\modeling_utils.py", line 2474, in from_pretrained
raise EnvironmentError(
OSError: Error no file named pytorch_model.bin, tf_model.h5, model.ckpt.index or flax_model.msgpack found in directory ../../../Pretraining_model/stable-diffusion-xl-base_1.0.
how do I fix it

lsx314159 changed discussion title from I cannot find config.json and Pytorch.bin,how to fix it to I cannot find config.json and pytorch_model.bin,how to fix it

I'm encountering the same issue as you. It's essential to verify if your local folder names are correct. In my situation, I discovered that the folder named 'text_encoder' had an inadvertent space preceding it, making it ' text_encoder'. This thrown error message led to confusion, as it suggested a missing 'config.json' or 'pytorch_model.bin' file in the current directory.

Sign up or log in to comment