research-contributions icon indicating copy to clipboard operation
research-contributions copied to clipboard

About Test

Open Ael0ria opened this issue 2 years ago • 4 comments

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.

Ael0ria avatar Jan 23 '24 11:01 Ael0ria

文件“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”

zhangxuan-thecastle avatar Mar 03 '24 09:03 zhangxuan-thecastle

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

ericspod avatar Mar 20 '24 17:03 ericspod

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!

Bigsealion avatar Apr 02 '24 12:04 Bigsealion

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

ASCI02 avatar Apr 03 '24 17:04 ASCI02