Project-MONAI / research-contributions

Implementations of recent research prototypes/demonstrations using MONAI.
https://monai.io/
Apache License 2.0
1.02k stars 334 forks source link

About Test #354

Open Dasha484 opened 9 months ago

Dasha484 commented 9 months ago

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 commented 8 months ago

文件“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 commented 7 months ago

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 commented 7 months ago

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 commented 7 months ago

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