fast-stable-diffusion
fast-stable-diffusion copied to clipboard
training cell error
Traceback (most recent call last):
File "/content/diffusers/examples/dreambooth/train_dreambooth.py", line 798, in <module>
main()
File "/content/diffusers/examples/dreambooth/train_dreambooth.py", line 557, in main
train_dataloader = torch.utils.data.DataLoader(
File "/usr/local/lib/python3.8/dist-packages/torch/utils/data/dataloader.py", line 344, in __init__
sampler = RandomSampler(dataset, generator=generator) # type: ignore[arg-type]
File "/usr/local/lib/python3.8/dist-packages/torch/utils/data/sampler.py", line 107, in __init__
raise ValueError("num_samples should be a positive integer "
ValueError: num_samples should be a positive integer value, but got num_samples=0
Traceback (most recent call last):
File "/usr/local/bin/accelerate", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.8/dist-packages/accelerate/commands/accelerate_cli.py", line 43, in main
args.func(args)
File "/usr/local/lib/python3.8/dist-packages/accelerate/commands/launch.py", line 837, in launch_command
simple_launcher(args)
File "/usr/local/lib/python3.8/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', '--image_captions_filename', '--save_starting_step=4000', '--stop_text_encoder_training=10', '--save_n_steps=4000', '--Session_dir=/content/gdrive/MyDrive/Fast-Dreambooth/Sessions/Gtzod', '--pretrained_model_name_or_path=/content/stable-diffusion-custom', '--instance_data_dir=/content/gdrive/MyDrive/Fast-Dreambooth/Sessions/Gtzod/instance_images', '--output_dir=/content/models/Gtzod', '--instance_prompt=', '--seed=513608', '--resolution=512', '--mixed_precision=fp16', '--train_batch_size=1', '--gradient_accumulation_steps=1', '--gradient_checkpointing', '--use_8bit_adam', '--learning_rate=2e-6', '--lr_scheduler=polynomial', '--lr_warmup_steps=0', '--max_train_steps=16000']' returned non-zero exit status 1.
Something went wrong
Have you already solved it?
You didn't upload instance images
Chat GPT tol me this
This error message indicates that there is a problem with the code in the file "/content/diffusers/examples/dreambooth/train_dreambooth.py" on line 798. The specific error is a "ValueError" that says "num_samples should be a positive integer value, but got num_samples=0". This means that the code is trying to create a data loader using a dataset with 0 samples, which is not valid.
To fix this error, you will need to investigate the code in the train_dreambooth.py file and determine why the dataset has 0 samples. This might be due to an error in how the dataset is constructed or loaded, or it might be due to an incorrect configuration of the code. Once you have identified the cause of the error, you can modify the code to fix the problem and prevent the dataset from having 0 samples. This should allow the code to run without encountering the ValueError.