TheLastBen / fast-stable-diffusion

fast-stable-diffusion + DreamBooth
MIT License
7.41k stars 1.28k forks source link

AttributeError: 'NoneType' object has no attribute 'pop' #2629

Open keymaster577 opened 8 months ago

keymaster577 commented 8 months ago

Every model I've tried to train on since the recent updates to the notebook has failed to load in Stable Diffusion, and has been returning the following code:

changing setting sd_model_checkpoint to crrefshr_step_1000.ckpt: AttributeError Traceback (most recent call last): File "C:\SSD\stable-diffusion-webui\modules\options.py", line 140, in set option.onchange() File "C:\SSD\stable-diffusion-webui\modules\call_queue.py", line 13, in f res = func(*args, **kwargs) File "C:\SSD\stable-diffusion-webui\modules\initialize_util.py", line 170, in shared.opts.onchange("sd_model_checkpoint", wrap_queued_call(lambda: sd_models.reload_model_weights()), call=False) File "C:\SSD\stable-diffusion-webui\modules\sd_models.py", line 741, in reload_model_weights state_dict = get_checkpoint_state_dict(checkpoint_info, timer) File "C:\SSD\stable-diffusion-webui\modules\sd_models.py", line 315, in get_checkpoint_state_dict res = read_state_dict(checkpoint_info.filename) File "C:\SSD\stable-diffusion-webui\modules\sd_models.py", line 301, in read_state_dict sd = get_state_dict_from_checkpoint(pl_sd) File "C:\SSD\stable-diffusion-webui\modules\sd_models.py", line 245, in get_state_dict_from_checkpoint pl_sd = pl_sd.pop("state_dict", pl_sd) AttributeError: 'NoneType' object has no attribute 'pop'

Gregorio305 commented 8 months ago

Same problem here, does anyone know how to fix it?

changing setting sd_model_checkpoint to msnn.ckpt: AttributeError Traceback (most recent call last): File "/home/studio-lab-user/content/x1101/modules/options.py", line 140, in set option.onchange() File "/home/studio-lab-user/content/x1101/modules/call_queue.py", line 13, in f res = func(*args, **kwargs) File "/home/studio-lab-user/content/x1101/modules/initialize_util.py", line 170, in shared.opts.onchange("sd_model_checkpoint", wrap_queued_call(lambda: sd_models.reload_model_weights()), call=False) File "/home/studio-lab-user/content/x1101/modules/sd_models.py", line 741, in reload_model_weights state_dict = get_checkpoint_state_dict(checkpoint_info, timer) File "/home/studio-lab-user/content/x1101/modules/sd_models.py", line 315, in get_checkpoint_state_dict res = read_state_dict(checkpoint_info.filename) File "/home/studio-lab-user/content/x1101/modules/sd_models.py", line 301, in read_state_dict sd = get_state_dict_from_checkpoint(pl_sd) File "/home/studio-lab-user/content/x1101/modules/sd_models.py", line 245, in get_state_dict_from_checkpoint pl_sd = pl_sd.pop("state_dict", pl_sd) AttributeError: 'NoneType' object has no attribute 'pop'

BosmansR commented 8 months ago

Also the same problem here, any fixes?

changing setting sd_model_checkpoint to crl_1107_step_4400.ckpt: AttributeError Traceback (most recent call last): File "/Users/rubenbosmans/Documents/StableDiffusion/stable-diffusion-webui/modules/options.py", line 140, in set option.onchange() File "/Users/rubenbosmans/Documents/StableDiffusion/stable-diffusion-webui/modules/call_queue.py", line 13, in f res = func(*args, **kwargs) File "/Users/rubenbosmans/Documents/StableDiffusion/stable-diffusion-webui/modules/initialize_util.py", line 170, in shared.opts.onchange("sd_model_checkpoint", wrap_queued_call(lambda: sd_models.reload_model_weights()), call=False) File "/Users/rubenbosmans/Documents/StableDiffusion/stable-diffusion-webui/modules/sd_models.py", line 741, in reload_model_weights state_dict = get_checkpoint_state_dict(checkpoint_info, timer) File "/Users/rubenbosmans/Documents/StableDiffusion/stable-diffusion-webui/modules/sd_models.py", line 315, in get_checkpoint_state_dict res = read_state_dict(checkpoint_info.filename) File "/Users/rubenbosmans/Documents/StableDiffusion/stable-diffusion-webui/modules/sd_models.py", line 301, in read_state_dict sd = get_state_dict_from_checkpoint(pl_sd) File "/Users/rubenbosmans/Documents/StableDiffusion/stable-diffusion-webui/modules/sd_models.py", line 245, in get_state_dict_from_checkpoint pl_sd = pl_sd.pop("state_dict", pl_sd) AttributeError: 'NoneType' object has no attribute 'pop'

Valachio commented 8 months ago

Exact same problem as all of you. After spending several hours training models using the author's notebook, and researching this issue online thinking it was a problem on my end... very frustrating!

It's been 2 weeks since this issue was created and no response from the author. This problem is currently making this jupyter notebook unusable.

BlenderProxy commented 7 months ago

I've got the same Issue with a model created on 13/11/2023 ( I've deleted and re-installed SD ) Same error. My other models are fine. It wants me to disable safe unpickle, but that's not safe.

ibaitxo commented 7 months ago

same problem here

BlenderProxy commented 7 months ago

I've found a solution...you can convert to safetensor and then it will load ok. https://github.com/diStyApps/Safe-and-Stable-Ckpt2Safetensors-Conversion-Tool-GUI

ibaitxo commented 7 months ago

I've found a solution...you can convert to safetensor and then it will load ok. https://github.com/diStyApps/Safe-and-Stable-Ckpt2Safetensors-Conversion-Tool-GUI

thank bro! it´s ready! :-)

Coders-by commented 2 weeks ago

I select a .ckpt model firstly, and then change back to a .safetensors model, it works!