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

'>=' not supported between instances of 'NoneType' and 'int'

Open jorgeajg opened this issue 3 years ago • 5 comments

Hello,

I am having this type of problem, when I use the notebook with the default values, only changing the number of subject images to 400, in the model training phase (not in the image generation phase) it throws the error shown below.

Steps: 0% 1/1500 [00:04<1:54:35, 4.59s/it, loss=0.0716, lr=2e-6]Traceback (most recent call last): File "/content/diffusers/examples/dreambooth/train_dreambooth.py", line 688, in main() File "/content/diffusers/examples/dreambooth/train_dreambooth.py", line 648, in main if args.save_n_steps >= 200: TypeError: '>=' not supported between instances of 'NoneType' and 'int' Steps: 0% 1/1500 [00:04<1:58:25, 4.74s/it, loss=0.0716, lr=2e-6] Traceback (most recent call last): File "/usr/local/bin/accelerate", line 8, in sys.exit(main()) File "/usr/local/lib/python3.7/dist-packages/accelerate/commands/accelerate_cli.py", line 43, in main args.func(args) File "/usr/local/lib/python3.7/dist-packages/accelerate/commands/launch.py", line 837, in launch_command simple_launcher(args) File "/usr/local/lib/python3.7/dist-packages/accelerate/commands/launch.py", line 354, in simple_launcher raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd) subprocess.CalledProcessError: Command '['/usr/bin/python3', '/content/diffusers/examples/dreambooth/train_dreambooth.py', '--train_text_encoder', '--pretrained_model_name_or_path=/content/stable-diffusion-v1-5', '--instance_data_dir=/content/data/JorgeGari', '--class_data_dir=/content/data/person', '--output_dir=/content/models/JorgeGari', '--with_prior_preservation', '--prior_loss_weight=1.0', '--instance_prompt=photo of JorgeGari person', '--class_prompt=a photo of a person, ultra detailed', '--seed=45576', '--resolution=512', '--mixed_precision=fp16', '--train_batch_size=1', '--gradient_accumulation_steps=1', '--gradient_checkpointing', '--use_8bit_adam', '--learning_rate=2e-6', '--lr_scheduler=constant', '--lr_warmup_steps=0', '--center_crop', '--max_train_steps=1500', '--num_class_images=400']' returned non-zero exit status 1. Something went wrong

Does anyone know why this error is thrown and how to fix it?

jorgeajg avatar Oct 24 '22 08:10 jorgeajg

hi, You're using an old notebook, use this link for the latest https://colab.research.google.com/github/TheLastBen/fast-stable-diffusion/blob/main/fast-DreamBooth.ipynb

TheLastBen avatar Oct 24 '22 08:10 TheLastBen

@TheLastBen but only if the number of class images is not changed.

jorgeajg avatar Oct 24 '22 09:10 jorgeajg

does your current notebook include the option : "Save_Checkpoint_Every_n_Steps" in the cell "start dreambooth" ?

TheLastBen avatar Oct 24 '22 09:10 TheLastBen

does your current notebook include the option : "Save_Checkpoint_Every_n_Steps" in the cell "start dreambooth" ?

the error TypeError: '>=' not supported between instances of 'NoneType' and 'int' means that Save_Checkpoint_Every_n_Steps isn't defined in the notebook, it should be a number

TheLastBen avatar Oct 24 '22 09:10 TheLastBen

@TheLastBen okay, I understand, thanks for the time invested in me, i will test it and close the issue when done

jorgeajg avatar Oct 24 '22 10:10 jorgeajg