faster rcnn报错:TypeError: slice indices must be integers or None or have an __index__ method
来源:互联网 发布:现在开淘宝店赚钱吗 编辑:程序博客网 时间:2024/06/16 20:13
博主之前在跑faster rcnn训练的时候别的问题都能按照网上教程解决唯独这个问题一直不行,去网上搜说是numpy有问题,我安装过conda所以我有两个numpy一个是pip安装的还有一个是conda安装的,我的python2.7使用的是conda环境下的,这个numpy坑确实不小,我对numpy一通乱改把conda装的降到了1.11.3,将pip安装的升到了1.13.3但还是不行,于是我就开始看代码改错了,我主要改的是/home/xiaohua/py-faster-rcnn/lib/roi_data_layer下的minibatch.py文件转到172行,将
for ind in inds:
cls = clss[ind]
start = 4 * cls
end = start + 4
bbox_targets[ind, start:end] = bbox_target_data[ind, 1:]
bbox_inside_weights[ind, start:end] = cfg.TRAIN.BBOX_INSIDE_WEIGHTS
return bbox_targets, bbox_inside_weights
改为:
for ind in inds:
ind = int(ind)
cls = clss[ind]
start = int(4 * cos)
end = int(start + 4)
bbox_targets[ind, start:end] = bbox_target_data[ind, 1:]
bbox_inside_weights[ind, start:end] = cfg.TRAIN.BBOX_INSIDE_WEIGHTS
return bbox_targets, bbox_inside_weights
即可,自己注意python语法格式哦。
- faster rcnn报错:TypeError: slice indices must be integers or None or have an __index__ method
- TypeError: slice indices must be integers or None or have an __index__ method
- TypeError: slice indices must be integers or None or have an __index__ method
- TypeError: slice indices must be integers or None or have an index method
- TypeError: slice indices must be integers or None or have an index method
- Python BeautifulSoup [解决方法] TypeError: list indices must be integers or slices, not str
- list indices must be integers or slices, not tuple
- python错误:TypeError: string indices must be integers
- matlab错误:Subscript indices must either be real positive integers or logicals.
- Subscript indices must either be real positive integers or logicals怎么解决
- matlab错误:Subscript indices must either be real positive integers or logicals.
- ride报错TypeError: exceptions must be old-style classes or derived from BaseException, not unicode
- 处理错误TypeError: initial_value must be unicode or None, not str
- TypeError: super(type, obj): obj must be an instance or subtype of type
- shiro使用报错---One or more realms must be present to execute an authentication attempt.
- Openstack 12.04 安装后 nova些列命令报错:ERROR: string indices must be integers, not str
- TypeError: argument 1 must be string or buffer, not instance
- Python TypeError: must be string or buffer, not dict
- 【转】23种设计模式之单例模式
- POJ1316 Self Numbers【水题】
- drawableLayout=侧滑
- 关于Python中的import(一)
- 几个连接HiveServer的客户端界面工具
- faster rcnn报错:TypeError: slice indices must be integers or None or have an __index__ method
- 禁用 Python GC,Instagram 性能提升10%
- Android蓝牙开发与蓝牙模块进行通讯(基于eclipse)
- 属性动画
- PostgreSQL学习手册(表的继承和分区)
- c语言 总结操作符使用 理解二进制存储
- 揭开Faiss的面纱 探究Facebook相似性搜索工具的原理
- etcdctl 使用说明
- Unity中一些优化方案