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

The first supplied array does not contain any binary object #47

Closed
Huiimin5 opened this issue Mar 14, 2022 · 5 comments
Closed

The first supplied array does not contain any binary object #47

Huiimin5 opened this issue Mar 14, 2022 · 5 comments

Comments

@Huiimin5
Copy link

Hi, thank you so much for your efforts in implementing all these methods.

After training on ACDC with labeled_num=3, the testing code on ACDC gives me this error "The first supplied array does not contain any binary object", which is raised near:
image

The problem is that the trained model does not predict labeled 2 and label 3, which can be seen here:
image

The visualized dice on validation set shows that there is a performance peak at 600th step
image

The test performance on the validation set (at 600th step) looks normal
image

It's confusing that on a test set image the same model does not prediction label 2 and 3 at all. Have you met this issue and could you give me some advice?

Many thanks.

@Luoxd1996
Copy link
Member

Hi,
Please use this function to measure the performance.

def calculate_metric_percase(pred, gt):
pred[pred > 0] = 1
gt[gt > 0] = 1
if pred.sum() > 0 and gt.sum() > 0:
dice = metric.binary.dc(pred, gt)
hd95 = metric.binary.hd95(pred, gt, voxelspacing=[10, 1, 1])
asd = metric.binary.asd(pred, gt, voxelspacing=[10, 1, 1])
return dice, hd95, asd
else:
return 0, 50, 10.
Best,
Xiangde.

@Huiimin5
Copy link
Author

Thanks a lot for your clarification.
By the way, in your work "Semi-Supervised Medical Image Segmentation via Cross Teaching between CNN and Transformer", you report standard deviation, is it calculated over each image? Basically for each foreground class, aside from taking the average over each image's dice, you also calculate the standard deviation, right?
Many thanks

@Luoxd1996
Copy link
Member

Hi, Huimin,
Yes, your understanding is right.
Best,
Xiangde.

@2805111860
Copy link

测试时我将代码改成你上面发布的,但还是出现“The first supplied array does not contain any binary object”,请问大佬这个该怎么解决呢?感谢你的贡献。

@supgy
Copy link

supgy commented Nov 6, 2023

测试时我将代码改成你上面发布的,但还是出现“The first supplied array does not contain any binary object”,请问大佬这个该怎么解决呢?感谢你的贡献。

have you soloved this problem?

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

4 participants