You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
0%| | 0/33 00:02
Traceback (most recent call last):
File "E:\study\yolov9-main\train.py", line 634, in
main(opt)
File "E:\study\yolov9-main\train.py", line 528, in main
train(opt.hyp, opt, device, callbacks)
File "E:\study\yolov9-main\train.py", line 304, in train
loss, loss_items = compute_loss(pred, targets.to(device)) # loss scaled by batch_size
File "E:\study\yolov9-main\utils\loss_tal.py", line 178, in call
pred_distri, pred_scores = torch.cat([xi.view(feats[0].shape[0], self.no, -1) for xi in feats], 2).split(
File "E:\study\yolov9-main\utils\loss_tal.py", line 178, in
pred_distri, pred_scores = torch.cat([xi.view(feats[0].shape[0], self.no, -1) for xi in feats], 2).split(
RuntimeError: shape '[32, 65, -1]' is invalid for input of size 131712
Logging results to runs\train\exp58
Starting training for 100 epochs...
0%| | 0/33 00:02
Traceback (most recent call last):
File "E:\study\yolov9-main\train.py", line 634, in
main(opt)
File "E:\study\yolov9-main\train.py", line 528, in main
train(opt.hyp, opt, device, callbacks)
File "E:\study\yolov9-main\train.py", line 304, in train
loss, loss_items = compute_loss(pred, targets.to(device)) # loss scaled by batch_size
File "E:\study\yolov9-main\utils\loss_tal.py", line 178, in call
pred_distri, pred_scores = torch.cat([xi.view(feats[0].shape[0], self.no, -1) for xi in feats], 2).split(
File "E:\study\yolov9-main\utils\loss_tal.py", line 178, in
pred_distri, pred_scores = torch.cat([xi.view(feats[0].shape[0], self.no, -1) for xi in feats], 2).split(
RuntimeError: shape '[32, 65, -1]' is invalid for input of size 131712
在训练yolov9-seg时报错,其中train.py配置文件如下所示:
def parse_opt(known=False):
parser = argparse.ArgumentParser()
# parser.add_argument('--weights', type=str, default=ROOT / 'yolo.pt', help='initial weights path')
# parser.add_argument('--cfg', type=str, default='', help='model.yaml path')
parser.add_argument('--weights', type=str, default='./yolov9-c-seg.pt', help='initial weights path')
parser.add_argument('--cfg', type=str, default='models/segment/gelan-c-seg.yaml', help='model.yaml path')
parser.add_argument('--data', type=str, default=ROOT / './data/my_coco.yaml', help='dataset.yaml path')
parser.add_argument('--hyp', type=str, default=ROOT / 'data/hyps/hyp.scratch-high.yaml', help='hyperparameters path')
parser.add_argument('--epochs', type=int, default=100, help='total training epochs')
parser.add_argument('--batch-size', type=int, default=1, help='total batch size for all GPUs, -1 for autobatch')
parser.add_argument('--imgsz', '--img', '--img-size', type=int, default=434, help='train, val image size (pixels)')
The text was updated successfully, but these errors were encountered: