Project-MONAI / MONAILabel

MONAI Label is an intelligent open source image labeling and learning tool.
https://docs.monai.io/projects/label
Apache License 2.0
567 stars 185 forks source link

MONAILabel torchsize error when training with 3d slicer #1613

Closed VSPuzzler closed 6 months ago

VSPuzzler commented 6 months ago

Hello. I am trying to use the train feature of MONAILabel using a dataset with masks that were created outside 3dslicer. It starts to do some initializing, but then I get a torch size error. Here is the error I am getting: image image

I am using a 2070 GPU with an i7 8700k CPU. I was able to run and train MONAILabel before on a different dataset, but I am only having an issue now, so I am confused on what the issue is.

tangy5 commented 6 months ago

Hi, torch size issue typically refers to the channel wise inconsistency, input data formats, or some parameters errors. You could double check the original model's usage before using it on additional data, check the inputs channels, image dimensions, etc.

VSPuzzler commented 6 months ago

Does this mean there is an issue in the data I am using?

diazandr3s commented 6 months ago

Hi @VSPuzzler,

Does this mean there is an issue in the data I am using?

It could be. We can help if you provide more details about the number of labels, label indexes and whether you've modified the pre-transforms for training.

Are you using a pre-trained model? It could also be that you are using a pre-trained model for segmenting a different number of labels. Try removing whatever is in the radiology/model folder

VSPuzzler commented 6 months ago

Hello, I think it was due to a model in the folder that I trained before that was causing the issue Thanks for the help.

diazandr3s commented 6 months ago

Thanks for letting us know, @VSPuzzler

VSPuzzler commented 6 months ago

Hello, actually that was not the issue. I re-ran it with with the empty models folder, but I am still having the issue.

VSPuzzler commented 6 months ago

Hi, I tried reinstalling monailabel, but that didn't fix anything either.

diazandr3s commented 6 months ago

Hi @VSPuzzler,

I suspect the issue comes from the dataset. Can you please provide more details of the task you are trying to run?

See this comment: https://github.com/Project-MONAI/MONAILabel/issues/1613#issuecomment-1871120295

VSPuzzler commented 6 months ago

Hello, I think there is a problem with the dataset where some of the masks do not match the images. I am trying to fix that right now and will let you know if that fixes it.

VSPuzzler commented 6 months ago

Hello, that was the issue. Thank you for the help.

diazandr3s commented 6 months ago

Thanks for letting us know, @VSPuzzler