stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

AttributeError: 'NoneType' object has no attribute 'keys'

Open MorphlingSan opened this issue 2 years ago • 6 comments

image i just follow the step and i get this, how to fix it?

MorphlingSan avatar Oct 12 '22 07:10 MorphlingSan

The model i use is Official Stable Diffusion 1.4

MorphlingSan avatar Oct 12 '22 07:10 MorphlingSan

venv "C:\Users\jndes\Desktop\stable-diffusion-webui\venv\Scripts\Python.exe" Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] Commit hash: 2fffd4bddce12b2c98a5bae5a2cc6d64450d65a0 Installing requirements for Web UI Launching Web UI with arguments: LatentDiffusion: Running in eps-prediction mode DiffusionWrapper has 859.52 M params. 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 Error verifying pickled file from C:\Users\jndes/.cache\huggingface\transformers\c506559a5367a918bab46c39c79af91ab88846b49c8abd9d09e699ae067505c6.6365d436cc844f2f2b4885629b559d8ff0938ac484c01a6796538b2665de96c7: Traceback (most recent call last): File "C:\Users\jndes\Desktop\stable-diffusion-webui\modules\safe.py", line 97, in load check_pt(filename) File "C:\Users\jndes\Desktop\stable-diffusion-webui\modules\safe.py", line 81, in check_pt unpickler.load() File "C:\Users\jndes\Desktop\stable-diffusion-webui\venv\lib\site-packages\torch_utils.py", line 138, in _rebuild_tensor_v2 tensor = _rebuild_tensor(storage, storage_offset, size, stride) File "C:\Users\jndes\Desktop\stable-diffusion-webui\venv\lib\site-packages\torch_utils.py", line 134, in rebuild_tensor return t.set(storage._untyped(), storage_offset, size, stride) RuntimeError: [enforce fail at ..\c10\core\impl\alloc_cpu.cpp:81] data. DefaultCPUAllocator: not enough memory: you tried to allocate 12582912 bytes.

The file may be malicious, so the program is not going to read it. You can skip this check with --disable-safe-unpickle commandline argument. Traceback (most recent call last): File "C:\Users\jndes\Desktop\stable-diffusion-webui\launch.py", line 169, in start_webui() File "C:\Users\jndes\Desktop\stable-diffusion-webui\launch.py", line 164, in start_webui webui.webui() File "C:\Users\jndes\Desktop\stable-diffusion-webui\webui.py", line 92, in webui initialize() File "C:\Users\jndes\Desktop\stable-diffusion-webui\webui.py", line 86, in initialize shared.sd_model = modules.sd_models.load_model() File "C:\Users\jndes\Desktop\stable-diffusion-webui\modules\sd_models.py", line 181, in load_model sd_model = instantiate_from_config(sd_config.model) File "C:\Users\jndes\Desktop\stable-diffusion-webui\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\jndes\Desktop\stable-diffusion-webui\repositories\stable-diffusion\ldm\models\diffusion\ddpm.py", line 461, in init self.instantiate_cond_stage(cond_stage_config) File "C:\Users\jndes\Desktop\stable-diffusion-webui\repositories\stable-diffusion\ldm\models\diffusion\ddpm.py", line 519, in instantiate_cond_stage model = instantiate_from_config(config) File "C:\Users\jndes\Desktop\stable-diffusion-webui\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\jndes\Desktop\stable-diffusion-webui\repositories\stable-diffusion\ldm\modules\encoders\modules.py", line 142, in init self.transformer = CLIPTextModel.from_pretrained(version) File "C:\Users\jndes\Desktop\stable-diffusion-webui\venv\lib\site-packages\transformers\modeling_utils.py", line 2006, in from_pretrained loaded_state_dict_keys = [k for k in state_dict.keys()] AttributeError: 'NoneType' object has no attribute 'keys'

MorphlingSan avatar Oct 12 '22 08:10 MorphlingSan

https://rentry.org/voldy#-guide- The Guide i follow

MorphlingSan avatar Oct 12 '22 08:10 MorphlingSan

https://www.reddit.com/r/StableDiffusion/comments/y0tiq7/help_with_error/

A legend from the discord helped me out. I navigated to C:/users/user/ .cache/ and then renamed the folder 'huggingface' to 'huggingfacebackup.' This allowed the program to redownload the files, which must have been corrupted.

imWildCat avatar Oct 24 '22 13:10 imWildCat

https://www.reddit.com/r/StableDiffusion/comments/y0tiq7/help_with_error/

A legend from the discord helped me out. I navigated to C:/users/user/ .cache/ and then renamed the folder 'huggingface' to 'huggingfacebackup.' This allowed the program to redownload the files, which must have been corrupted.

Thanks, same problem, this got me going again.

timbgray avatar Oct 26 '22 16:10 timbgray

https://www.reddit.com/r/StableDiffusion/comments/y0tiq7/help_with_error/

A legend from the discord helped me out. I navigated to C:/users/user/ .cache/ and then renamed the folder 'huggingface' to 'huggingfacebackup.' This allowed the program to redownload the files, which must have been corrupted.

Tried this and didn't fix my issue unfortunately. See my comment in related issue here https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/4174#issuecomment-1304300927

mnielsendev avatar Nov 04 '22 22:11 mnielsendev

@mnielsendev the issue is that you're out of RAM, probably. Try --lowram commandline argument, which will load model directly in VRAM, or increase your swap file size.

the error is DefaultCPUAllocator: not enough memory: you tried to allocate n bytes.

mezotaken avatar Jan 16 '23 19:01 mezotaken

@mnielsendev the issue is that you're out of RAM, probably. Try --lowram commandline argument, which will load model directly in VRAM, or increase your swap file size.

the error is DefaultCPUAllocator: not enough memory: you tried to allocate n bytes.

I actively use --lowram and still occasionally experience this issue (along with perhaps related issue #4541). I don't understand why I would be running out of RAM as I have 16GB RAM and nothing running in the background when using the WebUI. I did increase my paging file size on the relevant drive which seems to have helped reduce occurrences of these issues, but the question remains: Could it be that the requirements for running this exceed 16GB system RAM?

mnielsendev avatar Jan 17 '23 01:01 mnielsendev

I have 16gb of RAM and it happened to me often but only on startup. Since i increased swap file i never experienced the issue again. Also never used --lowram, or --lowvram or --medvram. (6gb vram) No, requirements for running it is about 5GB tops after model was loaded and about 9GB tops in the moment of loading, --lowram helps to avoid the peak. https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/6779 relevant

mezotaken avatar Jan 17 '23 06:01 mezotaken