mazurowski-lab / segmentation-guided-diffusion

[MICCAI 2024] Easy diffusion models (optionally with segmentation guidance) for medical images and beyond.
https://arxiv.org/abs/2402.05210
Other
56 stars 4 forks source link

diffusion_pytorch_model.safetensors save problem #9

Closed Liruieat closed 2 weeks ago

Liruieat commented 2 weeks ago

Firstly, thank you for your work on making a clean model for medical image generation I have problems in trying to insert my 3 channel cell images in the model. Is it normal to get the following prompt when saving weights during training?

self.eval_dataloader=<torch.utils.data.dataloader._SingleProcessDataLoaderIter object at 0x7fc126929750> of type <class 'torch.utils.data.dataloader._SingleProcessDataLoaderIter'> cannot be saved. self.external_config=TrainingConfig(model_type='DDIM', image_size=256, train_batch_size=52, eval_batch_size=8, num_epochs=400, gradient_accumulation_steps=1, learning_rate=0.0001, lr_warmup_steps=500, save_image_epochs=1, save_model_epochs=1, mixed_precision='fp16', output_dir='ddim-consep-256-segguided', push_to_hub=False, hub_private_repo=False, overwrite_output_dir=True, seed=0, segmentation_guided=True, segmentation_channel_mode='single', num_segmentation_classes=5, use_ablated_segmentations=False, dataset='consep', resume_epoch=None, class_conditional=False, cfg_p_uncond=0.2, cfg_weight=0.3, trans_noise_level=0.5, use_cfg_for_eval_conditioning=True, cfg_maskguidance_condmodel_only=True) of type <class 'training.TrainingConfig'> cannot be saved.

Thank you so much if you can help out on that.

nickk124 commented 2 weeks ago

Hi, this is normal behavior, your model weights should still be saving as normal. This warning is likely due to the customization I did to the diffusers functionality, and it only has to do with functionality that is not used in this codebase.

Hope it helps!