SuperMedIntel / Medical-SAM-Adapter

Adapting Segment Anything Model for Medical Image Segmentation
GNU General Public License v3.0
1.02k stars 90 forks source link

eval_seg() doesn't work properly in c>2 cases #121

Open CYXDBY opened 4 months ago

CYXDBY commented 4 months ago

In the eval_seg method in utils.py, the case where c > 2 is not working. It will prompt that pred is a numpy array and does not have a float() method. If torch.tensor(pred) is used at this point, it will cause vpred_cpu = vpred.cpu() to lose the channel dimension directly. I don't know why this happens, but when I write the code following the c == 2 case, everything works fine except that the vis export will duplicate each image 5 times. I hope to get some help. err ok Test10304 (97)+10304 (98)+epoch+1