MASILab / 3DUX-Net

240 stars 33 forks source link

About warning #21

Open zzzyzh opened 1 year ago

zzzyzh commented 1 year ago

Hi,

I find that each step of validation throws a waring like this: /root/miniconda3/envs/uxnet3d/lib/python3.8/site-packages/monai/transforms/utils.py:500: UserWarning: N foreground 0, N background 1713433,unable to generate class balanced samples.

What should I do?

leeh43 commented 1 year ago

Hi, do you mind to print our which sample it is and look into the corresponding sample? Seems like your data contains all pixels/voxels as background.

zzzyzh commented 1 year ago

I think that my label is a little bit small that model only get bg after randomcrop. Do you think this is possible?

leeh43 commented 1 year ago

Are you using the monai random crop function or the one that the current GitHub is using (Label crop)?

zzzyzh commented 1 year ago

Yes, I didn't change the code on your github, just the path and name

leeh43 commented 1 year ago

Sorry for the late reply. If the label is so small, I believe it still can be cropped. But the above warning is telling us that there is no foreground within the label region. I believe you need to double check with the input label for training.