positive666 / yolo_research

based on yolo-high-level project (detect\pose\classify\segment\):include yolov5\yolov7\yolov8\ core ,improvement research ,SwintransformV2 and Attention Series. training skills, business customization, engineering deployment C
GNU General Public License v3.0
756 stars 145 forks source link

大佬,代码运行报错 #66

Closed lulin1995 closed 2 years ago

lulin1995 commented 2 years ago

❔Question

完全没有运行起来就开始报这个错,不管是yolov5s.yaml还是yolov5_decoupled.yaml。

Additional context

Traceback (most recent call last): File "D:/objectcode/yolov5_research-master/train.py", line 662, in main(opt) File "D:/objectcode/yolov5_research-master/train.py", line 558, in main train(opt.hyp, opt, device, callbacks) File "D:/objectcode/yolov5_research-master/train.py", line 337, in train loss, loss_items = compute_loss_ota(pred, targets.to(device), imgs) if (compute_loss_ota is not None )else compute_loss(pred, targets.to(device)) # loss scaled by batch_siz File "D:\objectcode\yolov5research-master\utils\loss.py", line 224, in call pxy, pwh, , pcls = pi[b, a, gj, gi].tensor.split((2, 4, 5), dim=1) # target-subset of predictions AttributeError: 'Tensor' object has no attribute 'tensor'

positive666 commented 2 years ago

❔Question

完全没有运行起来就开始报这个错,不管是yolov5s.yaml还是yolov5_decoupled.yaml。

Additional context

Traceback (most recent call last): File "D:/objectcode/yolov5_research-master/train.py", line 662, in main(opt) File "D:/objectcode/yolov5_research-master/train.py", line 558, in main train(opt.hyp, opt, device, callbacks) File "D:/objectcode/yolov5_research-master/train.py", line 337, in train loss, loss_items = compute_loss_ota(pred, targets.to(device), imgs) if (compute_loss_ota is not None )else compute_loss(pred, targets.to(device)) # loss scaled by batch_siz File "D:\objectcode\yolov5research-master\utils\loss.py", line 224, in call pxy, pwh, , pcls = pi[b, a, gj, gi].tensor.split((2, 4, 5), dim=1) # target-subset of predictions AttributeError: 'Tensor' object has no attribute 'tensor'

现在应该没问题了吧

lulin1995 commented 2 years ago

❔Question

完全没有运行起来就开始报这个错,不管是yolov5s.yaml还是yolov5_decoupled.yaml。

Additional context

Traceback (most recent call last): File "D:/objectcode/yolov5_research-master/train.py", line 662, in main(opt) File "D:/objectcode/yolov5_research-master/train.py", line 558, in main train(opt.hyp, opt, device, callbacks) File "D:/objectcode/yolov5_research-master/train.py", line 337, in train loss, loss_items = compute_loss_ota(pred, targets.to(device), imgs) if (compute_loss_ota is not None )else compute_loss(pred, targets.to(device)) # loss scaled by batch_siz File "D:\objectcode\yolov5research-master\utils\loss.py", line 224, in call pxy, pwh, , pcls = pi[b, a, gj, gi].tensor.split((2, 4, 5), dim=1) # target-subset of predictions AttributeError: 'Tensor' object has no attribute 'tensor'

现在应该没问题了吧 大佬,虽然可以运行起来了,但是训练时的P、R、mAP值都出现不上升的情况,不为0,但是mAP只有0.0175左右这样不上升,在原版的YOLOv5里面mAP是可以上升到0.9左右的,自己的数据集

lulin1995 commented 2 years ago

❔Question

完全没有运行起来就开始报这个错,不管是yolov5s.yaml还是yolov5_decoupled.yaml。

Additional context

Traceback (most recent call last): File "D:/objectcode/yolov5_research-master/train.py", line 662, in main(opt) File "D:/objectcode/yolov5_research-master/train.py", line 558, in main train(opt.hyp, opt, device, callbacks) File "D:/objectcode/yolov5_research-master/train.py", line 337, in train loss, loss_items = compute_loss_ota(pred, targets.to(device), imgs) if (compute_loss_ota is not None )else compute_loss(pred, targets.to(device)) # loss scaled by batch_siz File "D:\objectcode\yolov5research-master\utils\loss.py", line 224, in call pxy, pwh, , pcls = pi[b, a, gj, gi].tensor.split((2, 4, 5), dim=1) # target-subset of predictions AttributeError: 'Tensor' object has no attribute 'tensor'

现在应该没问题了吧 大佬,虽然可以运行起来了,但是训练时的P、R、mAP值都出现不上升的情况,不为0,但是mAP只有0.0175左右这样不上升,在原版的YOLOv5里面mAP是可以上升到0.9左右的,自己的数据集,box和obj损失值还会为nan

positive666 commented 2 years ago

❔Question

完全没有运行起来就开始报这个错,不管是yolov5s.yaml还是yolov5_decoupled.yaml。

Additional context

Traceback (most recent call last): File "D:/objectcode/yolov5_research-master/train.py", line 662, in main(opt) File "D:/objectcode/yolov5_research-master/train.py", line 558, in main train(opt.hyp, opt, device, callbacks) File "D:/objectcode/yolov5_research-master/train.py", line 337, in train loss, loss_items = compute_loss_ota(pred, targets.to(device), imgs) if (compute_loss_ota is not None )else compute_loss(pred, targets.to(device)) # loss scaled by batch_siz File "D:\objectcode\yolov5research-master\utils\loss.py", line 224, in call pxy, pwh, , pcls = pi[b, a, gj, gi].tensor.split((2, 4, 5), dim=1) # target-subset of predictions AttributeError: 'Tensor' object has no attribute 'tensor'

现在应该没问题了吧 大佬,虽然可以运行起来了,但是训练时的P、R、mAP值都出现不上升的情况,不为0,但是mAP只有0.0175左右这样不上升,在原版的YOLOv5里面mAP是可以上升到0.9左右的,自己的数据集,box和obj损失值还会为nan

我下午测试一下 最近在做一些low-level的任务 没有管检测这块

lulin1995 commented 2 years ago

❔Question

完全没有运行起来就开始报这个错,不管是yolov5s.yaml还是yolov5_decoupled.yaml。

Additional context

Traceback (most recent call last): File "D:/objectcode/yolov5_research-master/train.py", line 662, in main(opt) File "D:/objectcode/yolov5_research-master/train.py", line 558, in main train(opt.hyp, opt, device, callbacks) File "D:/objectcode/yolov5_research-master/train.py", line 337, in train loss, loss_items = compute_loss_ota(pred, targets.to(device), imgs) if (compute_loss_ota is not None )else compute_loss(pred, targets.to(device)) # loss scaled by batch_siz File "D:\objectcode\yolov5research-master\utils\loss.py", line 224, in call pxy, pwh, , pcls = pi[b, a, gj, gi].tensor.split((2, 4, 5), dim=1) # target-subset of predictions AttributeError: 'Tensor' object has no attribute 'tensor'

现在应该没问题了吧 大佬,虽然可以运行起来了,但是训练时的P、R、mAP值都出现不上升的情况,不为0,但是mAP只有0.0175左右这样不上升,在原版的YOLOv5里面mAP是可以上升到0.9左右的,自己的数据集,box和obj损失值还会为nan

我下午测试一下 最近在做一些low-level的任务 没有管检测这块

好的,谢谢大佬

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.