edenartlab / sd-lora-trainer

LoRa trainer for SDXL and SD15
https://www.eden.art/
Other
26 stars 8 forks source link

`ValueError: Sample larger than population or is negative` when generating samples #6

Closed titlesxyz closed 2 months ago

titlesxyz commented 2 months ago
Traceback (most recent call last):
  File "/content/drive/MyDrive/sd-lora-trainer/main.py", line 565, in <module>
    for progress in train(config=config):
  File "/content/drive/MyDrive/sd-lora-trainer/main.py", line 433, in train
    validation_prompts = render_images(
  File "/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py", line 116, in decorate_context
    return func(*args, **kwargs)
  File "/content/drive/MyDrive/sd-lora-trainer/trainer/inference.py", line 323, in render_images
    validation_prompts_raw = random.sample(val_prompts["face"], n_imgs)
  File "/usr/lib/python3.10/random.py", line 482, in sample
    raise ValueError("Sample larger than population or is negative")
ValueError: Sample larger than population or is negative

I get this error consistently when using the face setting in Colab.

titlesxyz commented 2 months ago

myyyyy bad I accidentally set the number of generated samples to 66 instead of 6