WongKinYiu / yolov7

Implementation of paper - YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors
GNU General Public License v3.0
13.27k stars 4.18k forks source link

u7-seg error: AttributeError: 'list' object has no attribute 'shape' #1259

Open Robotatron opened 1 year ago

Robotatron commented 1 year ago

Using u7-seg branch for segmentation, using a mini COCO dataset (first 25k images). Getting an error: Traceback (most recent call last): File "seg/train.py", line 630, in <module> main(opt) File "seg/train.py", line 526, in main train(opt.hyp, opt, device, callbacks) File "seg/train.py", line 308, in train loss, loss_items = compute_loss(pred, targets.to(device)) # loss scaled by batch_size File "/home/jupyter/yolov7/seg/utils/loss.py", line 125, in __call__ tcls, tbox, indices, anchors = self.build_targets(p, targets) # targets File "/home/jupyter/yolov7/seg/utils/loss.py", line 198, in build_targets anchors, shape = self.anchors[i], p[i].shape AttributeError: 'list' object has no attribute 'shape'

Full console output: image

Robotatron commented 1 year ago

README says to use python seg/train.py, apparently its wrong. One should use python seg/segment/train.py and it works!