DeepTrial / Few-shot-Object-Detection-via-Feature-Reweighting

25 stars 9 forks source link

类型不对 #3

Open pujianjian opened 3 years ago

pujianjian commented 3 years ago

我运行的时候一直报类型不对,但我强制改变了以后还是不行,拜托帮忙看一下!

Traceback (most recent call last):
  File "/root/pujianjian/FSOD_VFR/train_meta.py", line 353, in <module>
    train(epoch)
  File "/root/pujianjian/FSOD_VFR/train_meta.py", line 198, in train
    loss,recall_rate,conf_proposal,loss_bbox,loss_conf,loss_cls = region_loss(output, target)
  File "/root/anaconda3/envs/Ppytorch/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in __call__
    result = self.forward(*input, **kwargs)
  File "/root/pujianjian/FSOD_VFR/models/layers/region_loss.py", line 313, in forward
    nH, nW, self.noobject_scale, self.object_scale, self.thresh, self.seen)
  File "/root/pujianjian/FSOD_VFR/models/layers/region_loss.py", line 126, in build_targets
    iou = bbox_iou(gt_box, pred_box, x1y1x2y2=False) # best_iou
  File "/root/pujianjian/FSOD_VFR/scripts/utils.py", line 32, in bbox_iou
    mx = min(box1[0]-box1[2]/2.0, box2[0]-box2[2]/2.0)
RuntimeError: Expected object of scalar type Float but got scalar type Double for argument #2 'other'
kirkzZ commented 2 years ago

Excuse me, have you successfully run this code