Replies: 1 comment
-
So, you want to fine-tune from the UNet of the InstructPix2Pix and NOT from the base SD UNet. The training script assumes the latter. Your modification won't be needed if you want to fine-tune from the InstructPix2Pix UNet as it already 8 channels in the input stem. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am currently working with a Instruct-pix2pix and encountered a RuntimeError related to tensor sizes when trying to copy weights between convolutional layers. The relevant part of my code is as follows:
in this code, I get the error
RuntimeError: The size of tensor a (4) must match the size of tensor b (8) at non-singleton dimension 1
However, when I modified the weight copying line to
new_conv_in.weight[:, :8, :, :].copy_(unet.conv_in.weight)
, the error was resolved, and the code ran without issues.I'm using the following command for training:
in
train_instruct_pix2pix.py
:My question is whether this modification is appropriate and will not adversely affect the functioning of the neural network. The original slicing was [:4], which seemed to be intended for a specific reason. By changing it to [:8], am I potentially causing any unintended side effects, particularly concerning how the weights are initialized and used in the network?
Any insights or recommendations regarding this issue would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions