Closed takuma104 closed 1 year ago
I got the same error. Also it's weird to me that tracker_project_name
is mandatory but it has a default value in the code. I think someone need to remove required=True
argument from the following code:
parser.add_argument(
"--tracker_project_name",
type=str,
default="train_controlnet",
required=True,
help=(
"The `project_name` argument passed to Accelerator.init_trackers for"
" more information see https://huggingface.co/docs/accelerate/v0.17.0/en/package_reference/accelerator#accelerate.Accelerator"
),
)
cc @williamberman can you check here?
I think since np.stack()
requires the underlying arrays to be of a uniform shape, this is being surfaced. WandB doesn't raise it because we log the images there individually.
A relatively easy fix would be just ensure the validation images are od the same shape when logging to TensorBoard.
Hi sorry for the delay here. Will try to take a look sometime this week
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
Gentle ping @williamberman here
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
Gentle ping here @williamberman
Sorry for missing this! This was fixed with this PR https://github.com/huggingface/diffusers/pull/2945 as the input images had 4 channels and the output images had 3 channels.
I double checked that there wasn't a lingering issue with different resolution input images. Different resolution input images work as the pipeline output resolutions are the same as the inputs and we don't call np.stack
cross different sets of validation inputs/outputs.
If anyone still has this problem due to bad sizing and want to log to tensorboard, padding can solve it.
formatted_images = np.stack(formatted_images)
->
max_width = max(image.shape[1] for image in formatted_images)
max_height = max(image.shape[0] for image in formatted_images)
padded_images = []
for image in formatted_images:
pad_width = max_width - image.shape[1]
pad_height = max_height - image.shape[0]
padded_image = np.pad(image, ((0, pad_height), (0, pad_width), (0, 0)), mode='constant', constant_values=0)
padded_images.append(padded_image)
formatted_images = np.stack(padded_images)
Describe the bug
I tried the training of the ControlNet in the main branch right away. The default option for
--report_to
is set totensorboard
, it seems to raise a ValueError and stop the process after generating validation images. As a workaround, usingwandb
did not cause this issue.Reproduction
Using this script (16GB sample from README.md, I added a mandatory
tracker_project_name
option):Adding the
--report_to wandb
option should prevent the issue.Logs