z1069614715 / objectdetection_script

一些关于目标检测的脚本的改进思路代码,详细请看readme.md
5.08k stars 460 forks source link

Aux OTA报错 #7

Closed WangRongsheng closed 1 year ago

WangRongsheng commented 1 year ago
tobj[b, a, gj, gi] = (1.0 - self.gr) + self.gr * iou.detach().clamp(0).type(tobj.dtype)  # iou ratio
RuntimeError: shape mismatch: value tensor of shape [71, 1] cannot be broadcast to indexing result of shape [71]
z1069614715 commented 1 year ago

pytorch版本要求大于12.1+

WangRongsheng commented 1 year ago

已解决,请使用cuda

WangRongsheng commented 1 year ago

请问aux_ota是不是工程代码不全?当val.py中:

# Loss
if compute_loss:
    loss += compute_loss(train_out, targets)[1]  # box, obj, cls

会出现:

File "/home/gem/val.py", line 214, in run
    loss += compute_loss(train_out, targets)[1]  # box, obj, cls
TypeError: __call__() missing 1 required positional argument: 'imgs'

当val.py中:

if compute_loss:
   loss += compute_loss(train_out, targets, im)[1]  # box, obj, cls

会出现:

  File "/home/gem/utils/loss_AuxOTA.py", line 276, in __call__
    pi_aux = p[i+self.nl]
IndexError: list index out of range
z1069614715 commented 1 year ago

请问你这个是把修改的文件复制到自己的项目上吗?你有使用到我的模型配置文件去载入吗,就是cfg参数

z1069614715 commented 1 year ago

这个我今早才自己跑过一次,正常的。

WangRongsheng commented 1 year ago

是的,我自己复制到自己项目的。 使用了您的yaml文件去载入。 cfg您使用的是当前工程中的哪个? 您有修改cfg吗?

WangRongsheng commented 1 year ago

已经修正!