WongKinYiu / yolov9

Implementation of paper - YOLOv9: Learning What You Want to Learn Using Programmable Gradient Information
GNU General Public License v3.0
8.8k stars 1.36k forks source link

Segmentation detect error: c, mh, mw = protos.shape # CHW AttributeError: 'list' object has no attribute 'shape' #528

Open bcnbruno opened 2 months ago

bcnbruno commented 2 months ago
          Okay, I think i found a solution for this one. You have to change line where process_mask function is called. So inside segment/predict.py change:
masks = process_mask(proto[i], det[:, 6:], det[:, :4], im.shape[2:], upsample=True) # HWC

into:

masks = process_mask(proto[2].squeeze(0), det[:, 6:], det[:, :4], im.shape[2:], upsample=True)  # HWC

That fixed the problem for me.

Originally posted by @wojhok in https://github.com/WongKinYiu/yolov9/issues/219#issuecomment-2020042996

plutus123 commented 2 months ago

Thanks it's working fine now

janelyd commented 1 month ago

i have tried the Instance Segmentation with yolov9 and i've also faced with the error : AttributeError: 'list' object has no attribute 'shape'.

This solution worked for me after dealing with this issue for hours. Thank you so much