AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
139.64k stars 26.47k forks source link

Error when i use webui-user.bat #1306

Closed AnderRedna closed 1 year ago

AnderRedna commented 1 year ago

making attention of type 'vanilla' with 512 in_channels Working with z of shape (1, 4, 32, 32) = 4096 dimensions. making attention of type 'vanilla' with 512 in_channels Traceback (most recent call last): File "C:\Users\Anderu\Documents\SDlocal\venv\lib\site-packages\transformers\modeling_utils.py", line 392, in load_state_dict return torch.load(checkpoint_file, map_location="cpu") File "C:\Users\Anderu\Documents\SDlocal\venv\lib\site-packages\torch\serialization.py", line 705, in load with _open_zipfile_reader(opened_file) as opened_zipfile: File "C:\Users\Anderu\Documents\SDlocal\venv\lib\site-packages\torch\serialization.py", line 242, in init super(_open_zipfile_reader, self).init(torch._C.PyTorchFileReader(name_or_buffer)) RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\Anderu\Documents\SDlocal\venv\lib\site-packages\transformers\modeling_utils.py", line 396, in load_state_dict if f.read().startswith("version"): File "C:\Users\Anderu\AppData\Local\Programs\Python\Python310\lib\encodings\cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 2077: character maps to

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\Anderu\Documents\SDlocal\launch.py", line 140, in start_webui() File "C:\Users\Anderu\Documents\SDlocal\launch.py", line 136, in start_webui import webui File "C:\Users\Anderu\Documents\SDlocal\webui.py", line 77, in shared.sd_model = modules.sd_models.load_model() File "C:\Users\Anderu\Documents\SDlocal\modules\sd_models.py", line 123, in load_model sd_model = instantiate_from_config(sd_config.model) File "C:\Users\Anderu\Documents\SDlocal\repositories\stable-diffusion\ldm\util.py", line 85, in instantiate_from_config return get_obj_from_str(config["target"])(config.get("params", dict())) File "C:\Users\Anderu\Documents\SDlocal\repositories\stable-diffusion\ldm\models\diffusion\ddpm.py", line 461, in init self.instantiate_cond_stage(cond_stage_config) File "C:\Users\Anderu\Documents\SDlocal\repositories\stable-diffusion\ldm\models\diffusion\ddpm.py", line 519, in instantiate_cond_stage model = instantiate_from_config(config) File "C:\Users\Anderu\Documents\SDlocal\repositories\stable-diffusion\ldm\util.py", line 85, in instantiate_from_config return get_obj_from_str(config["target"])(config.get("params", dict())) File "C:\Users\Anderu\Documents\SDlocal\repositories\stable-diffusion\ldm\modules\encoders\modules.py", line 142, in init self.transformer = CLIPTextModel.from_pretrained(version) File "C:\Users\Anderu\Documents\SDlocal\venv\lib\site-packages\transformers\modeling_utils.py", line 1978, in from_pretrained state_dict = load_state_dict(resolved_archive_file) File "C:\Users\Anderu\Documents\SDlocal\venv\lib\site-packages\transformers\modeling_utils.py", line 408, in load_state_dict raise OSError( OSError: Unable to load weights from pytorch checkpoint file for 'C:\Users\Anderu/.cache\huggingface\transformers\c506559a5367a918bab46c39c79af91ab88846b49c8abd9d09e699ae067505c6.6365d436cc844f2f2b4885629b559d8ff0938ac484c01a6796538b2665de96c7' at 'C:\Users\Anderu/.cache\huggingface\transformers\c506559a5367a918bab46c39c79af91ab88846b49c8abd9d09e699ae067505c6.6365d436cc844f2f2b4885629b559d8ff0938ac484c01a6796538b2665de96c7'. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True.

QuArkType commented 1 year ago

Hi! I also faced a similar issue. So what you have to do is: 1.Go to the path "C:\Users\Anderu/.cache" on your PC. 2.There, you will see the 'huggingface' folder somewhere. 3.Delete this folder and run webui-user.bat again.

Hope it helps!

AnderRedna commented 1 year ago

Its works for me!! Thks