Closed programmerZe closed 1 year ago
The Swin UNETR model uses 96x96x96 patch by default in the setting. I guess the data original volume is smaller than this size. You can add a "SpatialPadd" transform before the "RandCropByPosNegLabeld" transform here:
SpatialPadd: https://docs.monai.io/en/stable/transforms.html#spatialpadd
It works. Thank you! And I got another problem: the type of my label is scribble, so there are some unlabelled pixels. I need to use the parameter ignore_index
in loss function, but the DiceCELoss
function does not support it and return error. How can I fix it? Thanks!
Hi @programmerZe , I guess we have discussed this. I will close for now, feel free to reopen this if there are further problem.
Hi, thanks for your great work. I've tried to train UNETR model on ACDC dataset using the pretrained checkpoint. But I got error: "ValueError: The size of the proposed random crop ROI is larger than the image size." Could you please give me a solution? My training command is:
python main.py --batch_size=1 --logdir=unetr_pretrained --optim_lr=1e-4 --lrschedule=warmup_cosine --infer_overlap=0.5 --save_checkpoint --data_dir=../data/ACDC_training/ --pretrained_dir='./pretrained_models/' --pretrained_model_name='UNETR_model_best_acc.pth' --resume_ckpt --out_channels 4 --roi_x 256 --roi_y 256 --roi_z 16
Full error message: