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

Tensor size error in MedNextv1 trainer #34

Open
mariaperezf opened this issue Nov 6, 2024 · 3 comments
Open

Tensor size error in MedNextv1 trainer #34

mariaperezf opened this issue Nov 6, 2024 · 3 comments

Comments

@mariaperezf
Copy link

Hello, I am having trouble with the following Runtime Error:

RuntimeError: The size of tensor a (3) must match the size of tensor b (4) at non-singleton dimension 2

When trying to train a model using MedNext with the command:

mednextv1_train 3d_fullres nnUNetTrainerV2_MedNeXt_S_kernel3 999 0

@Helen52520
Copy link

Helen52520 commented Dec 12, 2024

Got the same error. Did you fix the problem? Thanks!

@mariaperezf
Copy link
Author

mariaperezf commented Dec 12, 2024

Got the same error. Did you fix the problem? Thanks!

No, not really. Although it does work if you use the preprocessing from the MICCAI 2023 that is shown in the READEME, so I guess it has something to do with the spacing:

mednextv1_plan_and_preprocess -t YOUR_TASK -pl3d ExperimentPlanner3D_v21_customTargetSpacing_1x1x1 -pl2d ExperimentPlanner2D_v21_customTargetSpacing_1x1x1

mednextv1_train 3d_fullres TRAINER TASK_NUMBER FOLD -p nnUNetPlansv2.1_trgSp_1x1x1

@Helen52520
Copy link

Got the same error. Did you fix the problem? Thanks!

No, not really. Although it does work if you use the preprocessing from the MICCAI 2023 that is shown in the READEME, so I guess it has something to do with the spacing:

mednextv1_plan_and_preprocess -t YOUR_TASK -pl3d ExperimentPlanner3D_v21_customTargetSpacing_1x1x1 -pl2d ExperimentPlanner2D_v21_customTargetSpacing_1x1x1

mednextv1_train 3d_fullres TRAINER TASK_NUMBER FOLD -p nnUNetPlansv2.1_trgSp_1x1x1

I successfully got it running with your command, thank you! By the way, may I ask if you're also working with multi-modality? The original command (-p nnUNetPlansv2.1) works for single-channel, but it fails for multi-modality.

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

2 participants