d8ahazard / sd_dreambooth_extension

Other
1.85k stars 283 forks source link

[Bug]: AttributeError: 'NoneType' object has no attribute 'keys' #1480

Open carlokarton opened 3 weeks ago

carlokarton commented 3 weeks ago

Is there an existing issue for this?

What happened?

Hi, I created a new model using SDXL and sd_xl_base_1.0.safetensors [31e35c80fc] after 16 hours I stopped the training at 50% (200 steps) and hit the create checkpoint.

But got the AttributeError: 'NoneType' object has no attribute 'keys' after 7 seconds

Steps to reproduce the problem

  1. Go to ....
  2. Press ....
  3. ...

Commit and libraries

Starting at Initializing Dreambooth and ending several lines below at [+] bitsandbytes version 0.35.4 installed..

Initializing Dreambooth Dreambooth revision: 45a12fe5950bf93205b6ef2b7511eb94052a241f Checking xformers... Checking bitsandbytes... Checking bitsandbytes (ALL!) Checking Dreambooth requirements... Installed version of bitsandbytes: 0.43.0 [Dreambooth] bitsandbytes v0.43.0 is already installed. Installed version of accelerate: 0.21.0 [Dreambooth] accelerate v0.21.0 is already installed. Installed version of dadaptation: 3.2 [Dreambooth] dadaptation v3.2 is already installed. Installed version of diffusers: 0.28.2 [Dreambooth] diffusers v0.25.0 is already installed. Installed version of discord-webhook: 1.3.0 [Dreambooth] discord-webhook v1.3.0 is already installed. Installed version of fastapi: 0.94.0 [Dreambooth] fastapi is already installed. Installed version of gitpython: 3.1.32 [Dreambooth] gitpython v3.1.40 is not installed. Successfully installed gitpython-3.1.43

Installed version of pytorch_optimizer: 2.12.0 [Dreambooth] pytorch_optimizer v2.12.0 is already installed. Installed version of Pillow: 9.5.0 [Dreambooth] Pillow is already installed. Installed version of tqdm: 4.66.4 [Dreambooth] tqdm is already installed. Installed version of tomesd: 0.1.3 [Dreambooth] tomesd v0.1.2 is already installed. Installed version of tensorboard: 2.13.0 [Dreambooth] tensorboard v2.13.0 is already installed. [+] torch version 2.1.2+cu121 installed. [+] torchvision version 0.16.2+cu121 installed. [+] accelerate version 0.21.0 installed. [+] diffusers version 0.28.2 installed. [+] bitsandbytes version 0.43.0 installed. [!] xformers NOT installed.

Command Line Arguments

no

Console logs

Error verifying pickled file from C:\Users\Windows\Documents\stable diffusion\sd.webui\webui\models\dreambooth\lililalulu\working\unet\diffusion_pytorch_model.bin
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\Windows\Documents\stable diffusion\sd.webui\webui\modules\safe.py", line 137, in load_with_extra
        check_pt(filename, extra_handler)
      File "C:\Users\Windows\Documents\stable diffusion\sd.webui\webui\modules\safe.py", line 84, in check_pt
        check_zip_filenames(filename, z.namelist())
      File "C:\Users\Windows\Documents\stable diffusion\sd.webui\webui\modules\safe.py", line 76, in check_zip_filenames
        raise Exception(f"bad file inside {filename}: {name}")
    Exception: bad file inside C:\Users\Windows\Documents\stable diffusion\sd.webui\webui\models\dreambooth\lililalulu\working\unet\diffusion_pytorch_model.bin: diffusion_pytorch_model/byteorder

Exception compiling checkpoint: 'NoneType' object has no attribute 'keys'
Traceback (most recent call last):
  File "C:\Users\Windows\Documents\stable diffusion\sd.webui\webui\extensions\sd_dreambooth_extension\dreambooth\diff_to_sdxl.py", line 357, in compile_checkpoint
    unet_state_dict = convert_unet_state_dict(unet_state_dict)
  File "C:\Users\Windows\Documents\stable diffusion\sd.webui\webui\extensions\sd_dreambooth_extension\dreambooth\diff_to_sdxl.py", line 108, in convert_unet_state_dict
    mapping = {k: k for k in unet_state_dict.keys()}
AttributeError: 'NoneType' object has no attribute 'keys'
Duration: 00:00:17

Additional information

No response

github-actions[bot] commented 1 week ago

This issue is stale because it has been open for 14 days with no activity. Remove stale label or comment or this will be closed in 30 days