1.TypeError: 'numpy.float64' object cannot be interpreted as an index 的解决方案

看了很多博客都说要调整numpy版本到1.11.0,这个方法或许能用,但不是根本方法,因为为了frcnn代码去调整一个包库的版本,属实饮鸩止渴,最好的方法就是去修改代码中出问题的地方,标记一下一个回答frcnn爬坑记录

需要补充的是,它的最后一个改错:

修改 /home/XXX/py-faster-rcnn/lib/rpn/proposal_target_layer.py,转到123行:

for ind in inds:cls = clss[ind]start = 4 * clsend = start + 4bbox_targets[ind, start:end] = bbox_target_data[ind, 1:]bbox_inside_weights[ind, start:end] = cfg.TRAIN.BBOX_INSIDE_WEIGHTSreturn bbox_targets, bbox_inside_weights

这里的ind,start,end都是 numpy.int 类型,这种类型的数据不能作为索引,所以必须对其进行强制类型转换,转化结果如下:

for ind in inds:ind = int(ind)cls = clss[ind]start = int(4 * cls)end = int(start + 4)bbox_targets[ind, start:end] = bbox_target_data[ind, 1:]bbox_inside_weights[ind, start:end] = cfg.TRAIN.BBOX_INSIDE_WEIGHTSreturn bbox_targets, bbox_inside_weight

最后一个单词,weights少了一个s,同时,/home/XXX/py-faster-rcnn/lib/roi_data_layer中也有一样的这个代码,也改掉。

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

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

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

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

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

  3. '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 ...

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

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

  5. ‘numpy.float64‘ object cannot be interpreted as an integer

    能运行的代码: import numpy as npaaa=np.linspace(0.2, 1, 9)print(aaa) 报错的代码: import numpy as npccc=np.round ...

  6. ‘numpy.float64‘ object is not callable

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

  7. TypeError: 'numpy.int64' object is not iterable ,'int' object is not iterable

    想用一个list来动态地增加numpy类型数据,如下面的代码所示,发现报错TypeError: 'numpy.int64' object is not iterable a = [] b = np.a ...

  8. TypeError: 'numpy.ndarray' object is not callable

    取ndarray的某几个数,若写为: a = np.array([0,1,2,3,4,5,6]) index = np.array([1,2,3]) b = a(index) print(b) 则会报 ...

  9. 成功解决TypeError: ‘float’ object cannot be interpreted as an index

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

最新文章

  1. 最全整理 | 万字长文综述目标检测领域,您要的,都在这里!
  2. @Transactional-同一个类中方法自调,调用方法事物失效
  3. brave浏览器_兼容Chrome 插件的Brave浏览器,带给你更快速的上网冲浪体验
  4. android中常用的下拉刷新加载更多_如何设计“加载流程”
  5. 如何保证消息队列里的数据顺序执行?
  6. poi导出word时替换的段落内容会多出一个}和逗号_办公族必备11个Word文字处理技巧,太实用了!...
  7. angular语言前端开发_2020年前端Angular招聘-前端Angular招聘求职信息-拉勾招聘
  8. 配置Typescript+Node环境
  9. 激光雷达(LiDAR)简介-森林资源调查应用
  10. 【CUDA编程】nsight compute和nsight system的使用
  11. python画图-python绘图入门(完整版)
  12. Variable @link-color is undefined
  13. java pptx,使用Java将文件.pptx转换为.ppt
  14. registry拉取dockerhub私有镜像
  15. AtCoder Beginner Contest 285 青大蒟蒻训练日常(A-F) 上分场(可惜unr)
  16. swfobject1.5
  17. 【数据结构】(森林)以孩子兄弟链表为存储结构,请设计递归算法求树的深度
  18. Android Camera了解一下
  19. java学籍管理系统课设报告,基于SSM+Redis+LayUI的大学生学籍信息管理系统-java学生学籍信息管理系统mysql数据源...
  20. 自考知识点计算机组成原理,自考计算机组成原理复习笔记

热门文章

  1. 2023年总结的web前端学习路线分享(学习导读)
  2. SRS4.0-使用rtmp2rtc.conf-使用docker搭建srs,推送webrtc流时等待时间超过5s,且推流期间会导致播放webrtc流卡住不动的问题,webrtc推流响应的时间过长
  3. 少一些计较多_人生多一些宽容,少一些计较!
  4. 04证券市场典型违法违规行为及法律责任
  5. [CF 757D] Felicity‘s Big Secret Revealed
  6. Mac上好用的优质的软件合集
  7. js 文字金额转换成汉字大写金额
  8. English Voice of We Don't Talk Anymore
  9. flyme禁止系统更新_Flyme系统更新最新版本
  10. MMDetection的安装