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

Following your tips, I'm getting the following error on my evaluation #7

Open
DongFangShenQiG opened this issue Aug 14, 2023 · 3 comments

Comments

@DongFangShenQiG
Copy link

Traceback (most recent call last):
File "/usr/local/data/guopeng/PointNu-Net-main/eval_pannuke_gai.py", line 156, in
main()
File "/usr/local/data/guopeng/PointNu-Net-main/eval_pannuke_gai.py", line 82, in main
[_, _, pq_bin], _ = get_fast_pq(true_bin, pred_bin) # compute PQ
File "/usr/local/data/guopeng/PointNu-Net-main/utils_eval.py", line 63, in get_fast_pq
p_mask = pred_masks[pred_id]
IndexError: list index out of range

@Kaiseem
Copy link
Owner

Kaiseem commented Aug 14, 2023

I recommend to manually check if the model output the correct prediction, e.g., visualization. If there is no problem, maybe you should check if there is any modification-caused BUG.

@wzr0108
Copy link

wzr0108 commented Feb 25, 2024

same problem, have you solved it?

@uiloatoat
Copy link

I found the same error,IndexError: list index out of range.
After checking, I found that in the mask.npy generated by the infer_pannuke.py process, the same nucleus can have two cell nucleus types. This resulted in one of the nuclei being removed by eval_pannuke.py, resulting in discontinuous labels. I added remap_label to /PanNuKe-metrics/run.py to make it run normally, but I only got an mPQ of 0.4891 and a bPQ of 0.6752, which is quite different from the paper.

for i in trange(true.shape[0]):
    pq = []
    pred_bin = binarize(pred[i,:,:,:5])
    true_bin = binarize(true[i,:,:,:5])
    if len(np.unique(true_bin)) == 1:
        pq_bin = np.nan # if ground truth is empty for that class, skip from calculation
    else:
        pred_bin = remap_label(pred_bin) # newly added
        [_, _, pq_bin], _ = get_fast_pq(true_bin, pred_bin)

Obviously my modification did not solve the fundamental problem. I think infer_pannuke.py should be modified to prevent a cell from being predicted as multiple types.
@Kaiseem Have you encountered this BUG before? need help

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