首页 > 其他分享 >loss.py:result type Float can't be cast to the desired output type long int

loss.py:result type Float can't be cast to the desired output type long int

时间:2023-03-13 12:33:27浏览次数:26  
标签:loss py Float 6.1 home type targets

Epoch gpu_mem box obj cls labels img_size 0%| | 0/1 [00:01 main(opt) File "/home/data/yolov5-6.1/train.py", line 539, in main train(opt.hyp, opt, device, callbacks) File "/home/data/yolov5-6.1/train.py", line 331, in train loss, loss_items = compute_loss(pred, targets.to(device)) # loss scaled by batch_size File "/home/data/yolov5-6.1/utils/loss.py", line 120, in __call__ tcls, tbox, indices, anchors = self.build_targets(p, targets) # targets File "/home/data/yolov5-6.1/utils/loss.py", line 217, in build_targets indices.append((b, a, gj.clamp_(0, gain[3] - 1), gi.clamp_(0, gain[2] - 1))) # image, anchor, grid indices RuntimeError: result type Float can't be cast to the desired output type long int 处理方式:

标签:loss,py,Float,6.1,home,type,targets
From: https://www.cnblogs.com/sinxsoft/p/17210946.html

相关文章

  • Python 报错“TypeError: School() takes no arguments”
    Python报错“TypeError:School()takesnoarguments”现象  原因__init__输入成__int__  解决方案   ......
  • contenttypes
    contenttypes组件的内部帮我们讲django的ORM中定义的所有表都自动手机起来,并保存至后续开发中如果遇到一张表与其他n张表进行关联,就可以基于contenttypes实现。表定......
  • float与double
    float与doubleC++标准指定了一个浮点数有效位数的最小值,大多数编译器实现了更高精度通常float以一个字32位表示,double以2个字64位表示float与double在内存中所占的比特......
  • typedef
    typedeftypedef概念typedef用来定义类型名,且是对已经存在的数据类型定义别名,没有创建新的类型typedef是编译时处理的,预处理,编译,汇编,链接typedef常见用法定义数组类......
  • [Typescript] Builder pattern - 05 Exercise
    classOverriden<TMapextendsobject={}>{privatemap:TMap;constructor(obj:TMap){this.map=obj;}build(){returnthis.map}me......
  • ifc4x3 IfcActuatorType
    ifc4x3 IfcActuatorType1语义定义分配控制元件类型IfcActuatorType定义了致动器出现的共同共享信息。共享信息集可以包括:具有共享属性集的公共财产共同表示法普通......
  • ES6-ES11 ES11String.prototype.matchAll
    原视频<!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><metaname="viewport"content="width=device-width,initial-scale=1.0"><title......
  • TypeScript——Record类型
    前言阅读vue源码的时候再次看到了TS这个类型,之前整理TS的时候简单了解了下,只知道是TS的高级类型,当时因为其他的事情也并没有正儿八经的的梳理完TS的东西,这时候来填下坑吧;......
  • TypeScript tsconfig.json declaration All In One
    TypeScripttsconfig.jsondeclarationAllInOne.d.tstsconfig.json{"compilerOptions":{"declaration":true,"declarationDir":"./types"}}......
  • can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the t
     如何解决这个问题:TypeError:can'tconvertcuda:0devicetypetensortonumpy.UseTensor.cpu()tocopythetensortohostmemoryfirst.这个错误通常出现在试......