在运行yolov5 train.py时出现了这个错误

解决方式:

将loss.py中gain = torch.ones(7, device=targets.device)改为gain = torch.ones(7, device=targets.device).long()即可。原因是新版本的torch无法自动执行此转换,旧版本torch可以。

loss.py在utils文件夹下,ctrl+f搜索gain,找到gain = torch.ones(7, device=targets.device),将其修改为gain = torch.ones(7, device=targets.device).long(),问题解决

解决错误:RuntimeError: result type Float can‘t be cast to the desired output type __int64相关推荐

  1. 解决Yolov5的RuntimeError: result type Float can‘t be cast to the desired output type long int 问题

    在yolov5中,直接下载github上的代码可能出现无法运行的情况,会报错 RuntimeError: result type Float can't be cast to the desired ...

  2. 训练yolo时报错RuntimeError: result type Float can‘t be cast to the desired output type __int64个人解决方案

    运行YOLOv5 6.1和yolor的时候,训练都没能正常运行,均出现了如下错误: AutoAnchor: 5.00 anchors/target, 1.000 Best Possible Recal ...

  3. RuntimeError: result type Float can‘t be cast to the desired output type __int64

    yolo问题:RuntimeError: result type Float can't be cast to the desired output type __int64 解决办法: loss.p ...

  4. YOLOV5报错:RuntimeError: result type Float can‘t be cast to the desired output type long int

    YOLOV5训练时报错: Traceback (most recent call last):   File "train.py", line 626, in <module ...

  5. YOLOv5训练报错:result type Float can‘t be cast to the desired output type __int64

    记录一个报错: 因为把Pytorch版本从1.8.0更新到1.13.1,YOLOv5-6.1版本的训练代码报错: RuntimeError: result type Float can't be ca ...

  6. 【Error Logs】YoloV5出现RuntimeError: result type Float can‘t be cast to the desired output

    问题描述 在训练 yolov5做简单的识别的时候出现,错误:RuntimeError: result type Float can't be cast to the desired output ty ...

  7. python报错:TypeError: cant multiply sequence by non-int of type float(bug)(csdn标题没法用英文引号,以后注意别搜引号)

    python报错:TypeError: can't multiply sequence by non-int of type 'float' 注意:csdn标题没法用英文引号,以后注意别搜引号!!!! ...

  8. Xubuntu22.04装有道词典:报错has unexpected type “float“(一百四十一)

    注意:python版本必须是python3.10以上才能运行. 1.前言: 在高版本Xubuntu22.04安装有道词典后,启动时,界面无法启动,通过手动启动后,发现以下报错log. # youdao ...

  9. 使用PyTorch前向运算时出现“RuntimeError: Expected object of scalar type Long but got scalar type Float for ……”

    1 问题描述 今天在使用PyTorch搭建模型时,出现了一个问题: RuntimeError: Expected object of scalar type Long but got scalar t ...

最新文章

  1. 一个云原生双活架构方案
  2. pop弹框 点击弹出外任意区域消失
  3. java数组扩容arraylist,ArrayList--扩容机制
  4. Fatal error: Call to undefined function gmp_strval() XAMPP 1.7.4 缺少php_gmp.dll
  5. Oracle数据库IP访问限制(IP白名单黑名单)
  6. 只做macd二次金叉_【教你一招】MACD低位二次金叉
  7. 高斯信道、单径Rayleigh信道和多径衰落信道下基带模型的多用户BPSK直接序列扩频系统MATLAB仿真(m序列、Gold序列和正交Gold序列)
  8. Kibana:数据分析的可视化利器
  9. 2017.6.12 crash的数字表格 思考记录
  10. OpenSatck Ironic实现裸机管理
  11. Java中TreeMap集合讲解
  12. iOS:类似于网易云音乐的刷新条目显示弹框
  13. 计算机的控制面板打不开,控制面板打不开,教您控制面板打不开怎么办
  14. win10 outlook2016 如何删除IMAP文件夹 (脑残党操作)
  15. Excel怎么插入按钮
  16. 商家门店会员管理,只要这五步,稳步提升销售额
  17. P9065 [yLOI2023] 云梦谣 题解
  18. 大厂码农在北京买房需要几年?
  19. 104键键盘布局高清示意图
  20. 怎么转换音频格式?建议收藏这几个方法

热门文章

  1. 实验三通过实验楼进行Ubuntu Linux的使用
  2. 人体姿态2019(八)Distribution-Aware Coordinate Representation for Human Pose Estimation
  3. Tracking Learning Detection (TLD)目标跟踪算法原理详解~PPT版
  4. 珍爱生命、健康生活。
  5. 设置不定长border-bottom
  6. Oracle语法to_char、to_date和add_months的用法
  7. TCPIP详解Protocol 读书笔记(九) IP选路
  8. 聚观早报 |梅西将于14日淘宝开播;李斌回应蔚来全系车型降3万元
  9. Eclipse历代版本
  10. 微软宣布开放其文档格式