Open rickbau5 opened 5 months ago
One other thing to note is that you can get a width or height of zero if one of the dimensions is less than reso_steps. So, for the usual reso_steps of 64, a 63x63 or 1024x63 image will wind up with a height of zero and cause a divide by zero error later.
Occasionally a dataset will result in a
ZeroDivisionError
, the dataset will reliably reproduce this error. The error is caused byreso[1]
being 0 here.In this case,
no_upscale
was set toTrue
so we would be in the branch here: https://github.com/kohya-ss/sd-scripts/blob/main/library/train_util.py#L259-L280. There are no 0 height images, so it must be thatimage_width * image_height > self.max_area
is true.That branch causes
bucket_height
to be set to 0 with this logic.