You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Textual Inversion got error of cannot find config.json file #579
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.
I had to git clone the CompVis/stable-diffusion-v1-4 repo and make this change to get mine to work (using a local path as --pretrained_model_name_or_path) :
# Load models and create wrapper for stable diffusiontext_encoder=CLIPTextModel.from_pretrained(
args.pretrained_model_name_or_path+"/text_encoder", use_auth_token=args.use_auth_token
)
vae=AutoencoderKL.from_pretrained(
args.pretrained_model_name_or_path+"/vae", use_auth_token=args.use_auth_token
)
unet=UNet2DConditionModel.from_pretrained(
args.pretrained_model_name_or_path+"/unet", use_auth_token=args.use_auth_token
)
Seems like the subfolder="" parameter isn't working?
It loads fine on the Colab when using a hosted runtime, but if you try to run the exact same steps with a local windows jupyter runtime it gives the same issue
nfigMixin._dict_from_json_file(cls, json_file)
298 with open(json_file, "r", encoding="utf-8") as reader:
--> 299 text = reader.read()
300 return json.loads(text)
File ~/miniconda3/envs/ldm/lib/python3.8/codecs.py:322, in BufferedIncrementalDecoder.decode(self, input, final)
321 data = self.buffer + input
--> 322 (result, consumed) = self._buffer_decode(data, self.errors, final)
323 # keep undecoded input until the next call
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 64: invalid start byte
During handling of the above exception, another exception occurred:
OSError Traceback (most recent call last)
/home/finn/code/lstein-diffusion/notebooks/sd_custom.ipynb Cell 4 in <cell line: 1>()
----> 1 vae = AutoencoderKL.from_pretrained(loadpath)
...
262 except (json.JSONDecodeError, UnicodeDecodeError):
--> 263 raise EnvironmentError(f"It looks like the config file at '{config_file}' is not a valid JSON file.")
265 return config_dict
OSError: It looks like the config file at '/home/finn/code/lstein-diffusion/models/ldm/stable-diffusion-v1/model.ckpt' is not a valid JSON file.
Hey @XavierXiao , @Oragi ! IAs pointed out by @2132660698 if you upgrade transformers version. to >=4.22.0 this should work. Because the subfolder argument isn't available in previous versions. I will update the minimum version in example requirements.
Блять, че я должен сделать чтобы эта хуета работала?
pip install transformers==4.22.0
Traceback (most recent call last):
File "/home/sergey/workspace/test-diffusers/./image_gen.py", line 5, in<module>
from diffusers import DiffusionPipeline
File "/home/sergey/workspace/test-diffusers/.venv/lib/python3.10/site-packages/diffusers/__init__.py", line 55, in<module>
from .pipelines import (
File "/home/sergey/workspace/test-diffusers/.venv/lib/python3.10/site-packages/diffusers/pipelines/__init__.py", line 18, in<module>
from .dance_diffusion import DanceDiffusionPipeline
File "/home/sergey/workspace/test-diffusers/.venv/lib/python3.10/site-packages/diffusers/pipelines/dance_diffusion/__init__.py", line 1, in<module>
from .pipeline_dance_diffusion import DanceDiffusionPipeline
File "/home/sergey/workspace/test-diffusers/.venv/lib/python3.10/site-packages/diffusers/pipelines/dance_diffusion/pipeline_dance_diffusion.py", line 21, in<module>
from ..pipeline_utils import AudioPipelineOutput, DiffusionPipeline
File "/home/sergey/workspace/test-diffusers/.venv/lib/python3.10/site-packages/diffusers/pipelines/pipeline_utils.py", line 64, in<module>
from transformers.utils import SAFE_WEIGHTS_NAME as TRANSFORMERS_SAFE_WEIGHTS_NAME
ImportError: cannot import name 'SAFE_WEIGHTS_NAME' from 'transformers.utils' (/home/sergey/workspace/test-diffusers/.venv/lib/python3.10/site-packages/transformers/utils/__init__.py)
pip install -U transformers
OSError: It looks like the config file at '/home/sergey/workspace/test-diffusers/CounterfeitV25_25.safetensors' is not a valid JSON file.
Activity
[-]Textual Inversion got 404 Client Error[/-][+]Textual Inversion got error of cannot find config.json file[/+]Oragi commentedon Sep 20, 2022
I had to git clone the CompVis/stable-diffusion-v1-4 repo and make this change to get mine to work (using a local path as --pretrained_model_name_or_path) :
to
Seems like the subfolder="" parameter isn't working?
It loads fine on the Colab when using a hosted runtime, but if you try to run the exact same steps with a local windows jupyter runtime it gives the same issue
patrickvonplaten commentedon Sep 22, 2022
Gently pinging @patil-suraj
crackedbeefcake commentedon Sep 24, 2022
might be related, I get something similar.
leads to:
2132660698 commentedon Sep 27, 2022
try this:
pip install transformers==4.22.1
patil-suraj commentedon Sep 28, 2022
Hey @XavierXiao , @Oragi ! IAs pointed out by @2132660698 if you upgrade transformers version. to
>=4.22.0this should work. Because thesubfolderargument 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
s3rgeym commentedon Mar 26, 2023
Блять, че я должен сделать чтобы эта хуета работала?
pip install transformers==4.22.0
pip install -U transformers
Мудацкое говно
s3rgeym commentedon Mar 26, 2023