yolov7 icon indicating copy to clipboard operation
yolov7 copied to clipboard

error when training yolov7-mask

Open mrljwlm opened this issue 2 years ago • 2 comments

I train the yolov7-mask using the following command: python train.py --project D:\train_log --workers 2 --device 0 --batch-size 8 --data data/coco.yaml --img 1024 1024 --cfg cfg/yolov7-mask.yaml --weights '' --name yolov7_mask --hyp data/hyp.scratch.mask.yaml

the following error occurred: Starting training for 300 epochs...

 Epoch   gpu_mem       box       obj       cls     total    labels  img_size

0%| | 0/333 [00:05<?, ?it/s] Traceback (most recent call last): File "train.py", line 613, in train(hyp, opt, device, tb_writer) File "train.py", line 365, in train loss, loss_items = compute_loss(pred, targets.to(device)) # loss scaled by batch_size File "I:\yolov7-mask\utils\loss.py", line 453, in call tcls, tbox, indices, anchors = self.build_targets(p, targets) # targets File "I:\yolov7-mask\utils\loss.py", line 516, in build_targets gain[2:6] = torch.tensor(p[i].shape)[[3, 2, 3, 2]] # xyxy gain KeyError: 0

how can i fix this error?

mrljwlm avatar Sep 09 '22 01:09 mrljwlm

我也遇到了这个问题,请问您这边解决了吗

13354236170 avatar Sep 13 '22 10:09 13354236170

Training code of yolov7-mask is not yet released (due to detectron2 dependency), currently u7 branch support training of yolov7-seg.

WongKinYiu avatar Sep 13 '22 10:09 WongKinYiu

我也遇到了这个问题,请问您这边解决了吗 解决没?

caisongan avatar Sep 25 '22 03:09 caisongan

Hi , Is training code of yolov7-mask released now?

LiamHO1999 avatar Jun 24 '23 09:06 LiamHO1999