AlibabaResearch / efficientteacher

A Supervised and Semi-Supervised Object Detection Library for YOLO Series
GNU General Public License v3.0
805 stars 147 forks source link

RuntimeError: result type Float can't be cast to the desired output type long int #142

Open Augestern-L opened 2 months ago

Augestern-L commented 2 months ago

1111111111

dreamerYCJ commented 2 months ago

朋友你解决了吗

Augestern-L commented 2 months ago

不好意思,没有及时回复你,这问题我已经解决了,只需要在gain[3]和gain[2]后面加上.long()把这两个参数调整为整数就行了,完整代码为: indices.append((b, a, gj.clamp(0, gain[3].long() - 1), gi.clamp(0, gain[2].long - 1))) # image, anchor, grid indices 后面我还遇到了一样的代码问题在691行,也是一样的解决办法: indices.append((b, a, gj.clamp(0, gain[3].long() - 1), gi.clamp(0, gain[2].long() - 1))) # image, anchor, grid indices