Kaiseem / PointNu-Net

PointNu-Net Project
MIT License
16 stars 1 forks source link

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

Open DongFangShenQiG opened 1 year ago

DongFangShenQiG commented 1 year ago

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_pannukegai.py", line 82, in main [, _, pqbin], = 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 commented 1 year ago

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

same problem, have you solved it?

uiloatoat commented 6 months ago

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