Open Teameviral opened 6 months ago
I had a similar problem But in my case it was:
Traceback (most recent call last):
File "yolov9/segment/train.py", line 646, in <module>
main(opt)
File "yolov9/segment/train.py", line 542, in main
train(opt.hyp, opt, device, callbacks)
File "yolov9/segment/train.py", line 297, in train
loss, loss_items = compute_loss(pred, targets.to(device), masks=masks.to(device).float())
File "yolov9/utils/segment/loss_tal.py", line 173, in __call__
batch_size, _, mask_h, mask_w = proto.shape
AttributeError: 'list' object has no attribute 'shape'
To fix this, I started using the models/segment/gelan-c-seg.yaml file instead of models/segment/yolov9-c-dseg.yaml
I don't think this is the solution for your case But, I hope this helps
Doing the work of @Youho99 here :) Your issue looks the same as #315 or #302. Probably you used a Yolov9 model with train.py. However, you need to use train_dual.py with a yolov9 model as train.py is only for Gelan models. Meaning you can either use a Gelan model with train.py as @Mecanight mentioned or use train_dual.py with the yolov9 model. (See #1)
Traceback (most recent call last):
File "/content/yolov9/train.py", line 634, in
Traceback (most recent call last): File "/content/yolov9/train.py", line 634, in
main(opt)
File "/content/yolov9/train.py", line 528, in main
train(opt.hyp, opt, device, callbacks)
File "/content/yolov9/train.py", line 304, in train
loss, loss_items = compute_loss(pred, targets.to(device)) # loss scaled by batch_size
File "/content/yolov9/utils/loss_tal.py", line 168, in call
pred_distri, pred_scores = torch.cat([xi.view(feats[0].shape[0], self.no, -1) for xi in feats], 2).split(
File "/content/yolov9/utils/loss_tal.py", line 168, in
pred_distri, pred_scores = torch.cat([xi.view(feats[0].shape[0], self.no, -1) for xi in feats], 2).split(
AttributeError: 'list' object has no attribute 'view'