Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

training on BTCV &&LiTS &&Spleen &&KiTS #11

Open
sharonlee12 opened this issue Dec 11, 2023 · 1 comment
Open

training on BTCV &&LiTS &&Spleen &&KiTS #11

sharonlee12 opened this issue Dec 11, 2023 · 1 comment

Comments

@sharonlee12
Copy link

HELLO,it is a great job,but i want to know how can I train the model on BTCV &&LiTS &&Spleen &&KiTS.As BTCV contains 14 classes,and when I train the model, it will report an error: assert t<=num_classes
should I preprocess the BTCV data set,concert 2&3 (left&right kidney) to 2, 1 (spleen) to 3 and 6 (liver) to 1, 4-14 to 0, right?
if so,Do I need to pre-process the LITS data set,to combine organs and tumors and set them 1,and for KITS, to combine organs and tumors and set them 2?
or should I change the num_classes from 4 to 14 when training on BTCV &&LiTS &&Spleen &&KiTS?
Hope to get your reply, thank you!

@sharonlee12
Copy link
Author

hello,I try to modify in the training file like this:
if(data_type=='1'):
label_batch[label_batch == 1] = 1 # liver
label_batch[label_batch == 2] = 1 # liver
if(data_type=='2'):
label_batch[label_batch == 1] = 2 #kid
label_batch[label_batch == 2] = 2 #kid
if(data_type=='3'):
label_batch[label_batch == 1] = 3 #spleen
if(data_type=='4'):
label_batch[label_batch == 1] = 3 # spleen
label_batch[label_batch == 2] = 2 # rkid + lkid
label_batch[label_batch == 3] = 2 # rkid + lkid
label_batch[label_batch == 4] = 0 #
label_batch[label_batch == 5] = 0 #
label_batch[label_batch == 6] = 1 # liver
label_batch[label_batch > 6] = 0
1111111111111111
but while training there is an error:
../aten/src/ATen/native/cuda/NLLLoss2d.cu:93: nll_loss2d_forward_kernel: block: [2,0,0], thread: [384,0,0] Assertion t >= 0 && t < n_classes failed.
../aten/src/ATen/native/cuda/NLLLoss2d.cu:93: nll_loss2d_forward_kernel: block: [2,0,0], thread: [385,0,0] Assertion t >= 0 && t < n_classes failed.
../aten/src/ATen/native/cuda/NLLLoss2d.cu:93: nll_loss2d_forward_kernel: block: [2,0,0], thread: [386,0,0] Assertion t >= 0 && t < n_classes failed.

I hope to know where is the problem with my settings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant