-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Closed as not planned
Closed as not planned
Copy link
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
I was studying the train_dreambooth.py script (link) and noticed that the DreamBoothDataset performs an image normalization step as one of the transforms (line 260), setting mean to 0.5 and standard deviation to 0.5:
self.image_transforms = transforms.Compose(
[
transforms.Resize(size, interpolation=transforms.InterpolationMode.BILINEAR),
transforms.CenterCrop(size) if center_crop else transforms.RandomCrop(size),
transforms.ToTensor(),
transforms.Normalize([0.5], [0.5]), # <--- this line
]
)However, this seems to differ from the original Stable Diffusion training implementation, which instead rescales image pixel values from [0, 255] to [0, 1] (link, line 369):
example["image"] = (image/127.5 - 1.0).astype(np.float32)
example["LR_image"] = (LR_image/127.5 - 1.0).astype(np.float32)Is there a reason for the discrepancy? Was wondering if this was intended or a bug - it seems like changing the normalization procedure from the original model would impact fine-tuning performance. Thanks for the help!
Reproduction
No response
Logs
No response
System Info
Latest version
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working