maskbit icon indicating copy to clipboard operation
maskbit copied to clipboard

Method reconstructed_and_predicted_images called with incorrect arguments

Open AleksandarRoncevic opened this issue 1 year ago • 1 comments

This is just a small remark that in the script train_maskbit.py on L473, you are calling the method reconstructed_and_predicted_images as following:

reconstructed_and_predicted_images(
      vqgan_model,
      config,
      input_tokens[:config.training.num_generated_images], 
      predicted_tokens[:config.training.num_generated_images],
      masks[:config.training.num_generated_images],
      fnames[:config.training.num_generated_images],
      accelerator,
      global_step+1,
      output_dir
  )

While the signature of that function a bit further below is;

def reconstructed_and_predicted_images(
    vqgan_model: torch.nn.Module,
    config,
    tokens: torch.Tensor,
    predicted_tokens: torch.Tensor,
    accelerator,
    global_step: int,
)

Which causes the script to crash when during training when it comes to the if-check block.

Thank you for sharing the code!

AleksandarRoncevic avatar Feb 11 '25 11:02 AleksandarRoncevic

Thanks Aleksander! It should be fixed now.

markweberdev avatar Feb 27 '25 07:02 markweberdev