d8ahazard / sd_dreambooth_extension

Other
1.85k stars 283 forks source link

[Bug]: AttributeError: 'NoneType' object has no attribute 'dtype' #1430

Closed M4CC closed 6 months ago

M4CC commented 6 months ago

Is there an existing issue for this?

What happened?

Getting the following error:

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

After trying to "Train" on Dreambooth

Steps to reproduce the problem

I followed this tutorial: https://www.nextdiffusion.ai/tutorials/dreambooth-super-easy-ai-model-training-with-automatic-1111

Couldn't find "xformers" on that specific dropdown though, just using "default".

Does it mean I need to install it somehow?

Commit and libraries

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

Command Line Arguments

@echo off

set PYTHON=
set GIT=
set VENV_DIR=
set COMMANDLINE_ARGS=
set "XFORMERS_PACKAGE=xformers==0.0.21"
:: Use the below argument if getting OOM extracting checkpoints
set COMMANDLINE_ARGS=--ckptfix
set "REQS_FILE=.\extensions\sd_dreambooth_extension\requirements.txt"
:: Uncomment below to skip trying to install automatically on launch.
set "DREAMBOOTH_SKIP_INSTALL=True"
:: Use this to launch with accelerate (Run 'accelerate config' first, launch once without to install dependencies)
:: set ACCELERATE="True"

call webui.bat

Console logs

Getting the following error:

  File "F:\ai\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\ui_functions.py", line 735, in start_training
    result = main(class_gen_method=class_gen_method)
  File "F:\ai\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\train_dreambooth.py", line 1917, in main
    return inner_loop()
  File "F:\ai\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\memory.py", line 126, in decorator
    return function(batch_size, grad_size, prof, *args, **kwargs)
  File "F:\ai\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\train_dreambooth.py", line 463, in inner_loop
    and accelerator.unwrap_model(text_encoder_two).dtype != torch.float32
AttributeError: 'NoneType' object has no attribute 'dtype'

Additional information

Thanks in advance for your help and for all the hard work creating this extension!

M4CC commented 6 months ago

Oops, I installed Cuda and it's working just fine now. Sorry.

oozanyaman commented 5 months ago

I got the same error but I have cuda installed. (RTX3060 cuda version: cuda_12.3.r12.3) whats happend :(