Conversation
…hDataset ControlNetDataset.__init__ constructs an internal DreamBoothDataset via positional arguments. PR #2309 inserted a new train_inpainting parameter into DreamBoothDataset.__init__ between prior_loss_weight and debug_dataset, but this delegate call was not updated, so every subsequent positional argument was shifted by one slot: - train_inpainting <- received debug_dataset (bool, type-correct but logically wrong: enables inpainting whenever debug mode is on) - debug_dataset <- received validation_split (float) - validation_split <- received validation_seed (int) - validation_seed <- received resize_interpolation (str) - resize_interpolation <- received skip_image_resolution (tuple) - skip_image_resolution <- defaulted to None (missing) This breaks ControlNet training entirely. Forward the dataset's own train_inpainting attribute to keep the delegate consistent.
Commit ff7945d (PR #2309) fixed the masks/masked_images batch shapes from [B,1,1,H,W]/[B,1,C,H,W] to [B,1,H,W]/[B,C,H,W] and replaced the per-item F.interpolate loop with a single batched call in fine_tune.py, train_db.py, train_network.py, and sdxl_train.py — but train_textual_inversion.py was missed. After ff7945d batch["masks"] is [B,1,H,W]; iterating over it yields [1,H,W] slices. F.interpolate on a 3D tensor with a 2-element size argument performs 1D interpolation and errors on the dimension mismatch, so textual-inversion inpainting training crashes on the first step. Replace the loop+stack with the same single-call form used by the other training scripts, and drop the now-redundant .reshape() workaround.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow up for #2309.