能运行的代码:

import numpy as npaaa=np.linspace(0.2, 1, 9)print(aaa)

报错的代码:

import numpy as npccc=np.round((0.95 - .5) / .05)
print(ccc)iouThrs = np.linspace(0.5, 0.95, ccc + 1, endpoint=True)print(iouThrs)

原因:

np.round 函数默认返回是0位小数,但是数据类型是float64类型,不是int类型。

ccc+1这个参数需要是int类型,不是float64类型。

解决方法:

import numpy as npccc=np.round((0.95 - .5) / .05)
print(ccc)iouThrs = np.linspace(0.5, 0.95, int(ccc) + 1, endpoint=True)print(iouThrs)

‘numpy.float64‘ object cannot be interpreted as an integer相关推荐

  1. 'numpy.float64' object cannot be interpreted as an integer

    'numpy.float64' object cannot be interpreted as an integer fp=open(filename,'rb') blk_size = prod(di ...

  2. 训练数据出现TypeError: 'numpy.float64' object cannot be interpreted as an integer错误

    问题背景: 用tensorflow训练自己的数据的时候,训练一段时间后,出现TypeError: 'numpy.float64' object cannot be interpreted as an ...

  3. 《python计算机视觉》关于‘numpy.float64‘ object cannot be interpreted as an integer错误的解决办法

    在<python计算机视觉>这本书的学习中,按照书中的代码敲完运行会发现这个报错: 运行代码如下: # Warp_Triangle_Image01.pyfrom pylab import ...

  4. Yolov6解决常见报错(1)TypeError numpy.float64 object cannot be interpreted as an index

    这几天偶然看见Yolov6出来,迫不及待的试了一下,结果看见网上评论说bug太多了,我作为使用者,想着积极做出贡献,把一些我解决的bug分享一下,方便大家也能看到顺便解决. 先看报错 Training ...

  5. frcnn系列错误: TypeError: 'numpy.float64' object cannot be interpreted as an index 的解决方案

    1.TypeError: 'numpy.float64' object cannot be interpreted as an index 的解决方案 看了很多博客都说要调整numpy版本到1.11. ...

  6. ‘numpy.float64‘ object is not callable

    重点放最前面:检查函数名是否和变量名重复,或者被重新定义了. 我自己定义的一个函数如下. def rmspe(y, yhat):return np.sqrt(np.mean((yhat/y-1) ** ...

  7. 成功解决TypeError: ‘float‘ object cannot be interpreted as an integer

    问题描述: 在使用Python的for w in range(0.0, 4.1, 0.1):时遇到报错: TypeError: 'float' object cannot be interpreted ...

  8. 生成浮点数列表:Python range():TypeError: ‘float‘ object cannot be interpreted as an integer

    生成浮点数列表:Python range():TypeError: 'float' object cannot be interpreted as an integer 目录 Python range ...

  9. 成功解决TypeError: 'float' object cannot be interpreted as an integer

    成功解决TypeError: 'float' object cannot be interpreted as an integer 目录 解决问题 解决思路 解决方法 解决问题 TypeError: ...

最新文章

  1. 新建ROS工作工作空间
  2. 静态代码块、非静态代码块、构造函数执行顺序
  3. 有用的正则表达式或JS方法
  4. fireFox模拟 post请求、上传插件,火狐浏览器中文postman插件
  5. Java学习之路 之 使用技巧篇
  6. P2922 [USACO08DEC]秘密消息Secret Message
  7. 数据帮助类(DataHelper)
  8. 【优化求解】基于matlab NSGA2算法多技能员工调度优化模型【含Matlab源码 1775期】
  9. 新疆职称英语和职称计算机,职称计算机考试题库
  10. 通过手机获取微信公众号封面
  11. ASP.NET WEB介绍
  12. 利用在线词典批量查询英语单词
  13. java进阶知识思维导图
  14. Python小记:14.数据分析基础知识点汇总
  15. 【委托】—是什么怎么用什么用
  16. APP进行微信分享,提示签名不一致解决方案
  17. 编程题目:使用C++语言模拟完成一个简单的计算机系统
  18. Indie Maker 一个人的创业
  19. Java中比较数字的大小
  20. U3D客户端框架之 拓展StringBuilder实现InsertNoGC、IndexOf、LastIndexOf、ReplaceNoGC、AppendNoGC API 减少GC

热门文章

  1. uclinux与linux的区别
  2. IDA中的SIG应用
  3. 新一代 Linux 文件系统 btrfs 简介
  4. 织梦防html5,最近织梦DEDECMS被注入漏洞,如何做好防护措施。
  5. hvie struct 怎么查训_hive的数据类型
  6. c语言为什么提供函数声明机制,通过实战理解C语言精要——函数篇
  7. unordered_map 碰撞处理 重哈希
  8. 逃计算机课检讨书600字,检讨书600字3篇
  9. postgresql导入mysql的备份_PostgreSQL数据备份、导入转
  10. 杭州java班学费多少_杭州学java费用多少