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

About Test #354

Open
Dasha484 opened this issue Jan 23, 2024 · 4 comments
Open

About Test #354

Dasha484 opened this issue Jan 23, 2024 · 4 comments

Comments

@Dasha484
Copy link

When I run test.py, an error is reported in the console. The traceback is as follows:
Traceback (most recent call last):
File "test.py", line 121, in
main()
File "test.py", line 94, in main
original_affine = batch["label_meta_dict"]["affine"][0].numpy()
KeyError: 'label_meta_dict'
How should I fix this?Additionally, how can I obtain the segmentation accuracy for each organ in the BTCV dataset? Looking forward to your response.
This is the "val" part of my dataset.json.
"validation": [
{
"image": "imagesTr/img0035.nii.gz",
"label": "labelsTr/label0035.nii.gz"
},
{
"image": "imagesTr/img0036.nii.gz",
"label": "labelsTr/label0036.nii.gz"
},
{
"image": "imagesTr/img0037.nii.gz",
"label": "labelsTr/label0037.nii.gz"
},
{
"image": "imagesTr/img0038.nii.gz",
"label": "labelsTr/label0038.nii.gz"
},
{
"image": "imagesTr/img0039.nii.gz",
"label": "labelsTr/label0039.nii.gz"
},
{
"image": "imagesTr/img0040.nii.gz",
"label": "labelsTr/label0040.nii.gz"
}
]
Looking forward to your response.

@zhangxuan-thecastle
Copy link

文件“test.py”,第 121 行,在
main() 文件“test.py”,第 94 行,在主
original_affine = batch[“label_meta_dict”][“affine”][0].numpy()

KeyError:“label_meta_dict”

I have also encountered this problem. How can I solve “label_meta_dict” and “affine”

@ericspod
Copy link
Member

The issue with the key error may be related to changes to LoadImaged such that it doesn't produce the metadata dictionary any more. Wherever LoadImaged occurs add the argument image_only=False to produce the dictionary. For the metric, there would have to be quite significant changes to how the dice is calculated here, the MONAI DiceMetric class would allow per-class values to be calculated. @ahatamiz or @upupming I think you worked on this as well? Thanks

@Bigsealion
Copy link

The issue with the key error may be related to changes to LoadImaged such that it doesn't produce the metadata dictionary any more. Wherever LoadImaged occurs add the argument image_only=False to produce the dictionary. For the metric, there would have to be quite significant changes to how the dice is calculated here, the MONAI DiceMetric class would allow per-class values to be calculated. @ahatamiz or @upupming I think you worked on this as well? Thanks

Hello, may I ask which version of MONAI corresponds to the current swinUNETR? I'm unable to install it from the requirements.txt. Thank you!

@ASCI02
Copy link

ASCI02 commented Apr 3, 2024

The issue with the key error may be related to changes to LoadImaged such that it doesn't produce the metadata dictionary any more. Wherever LoadImaged occurs add the argument image_only=False to produce the dictionary. For the metric, there would have to be quite significant changes to how the dice is calculated here, the MONAI DiceMetric class would allow per-class values to be calculated. @ahatamiz or @upupming I think you worked on this as well? Thanks

Hello, may I ask which version of MONAI corresponds to the current swinUNETR? I'm unable to install it from the requirements.txt. Thank you!
You can install monai version 1.1.0 with 'pip install 'monai[all]==1.1.0'', which works for swinunetr

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

5 participants