由于除法/自动产生的类型是浮点型,因此出现上述错误,修正方法为,将/更改为//

 roi_gray_lwpCV = gray_lwpCV[y:y + h // 2, x:x + w]  # 检出人脸区域后,取上半部分,因为眼睛在上边啊,这样精度会高一些
roi_frame_lwpCV = frame_lwpCV[y:y + h // 2, x:x + w]

TypeError: slice indices must be integers or None or have an __index__ method的更多相关文章

  1. faster rcnn报错:TypeError: slice indices must be integers or None or have an __index__ method

    https://blog.csdn.net/qq_27637315/article/details/78849756 https://blog.csdn.net/qq_21089969/article ...

  2. macTypeError: slice indices must be integers or None or have an index method

    一般是由于Numpy的版本太高了(1.12对此进行了调整),有的时候传入numpy array里面的索引可能是浮点数,这个时候最好检查一下索引强制转换为int类型 或者安装低版本的numpy sudo ...

  3. TypeError: string indices must be integers, not str

    1. TypeError: string indices must be integers, not str 字符串类型取第index个字符的时候,应该传入int而不是str.如 1 a='abcde ...

  4. TypeError: list indices must be integers or slices, not str

    错误如下: TypeError: list indices must be integers or slices, not str 错误代码块: aa是一组list套dict数据 函数insert接收 ...

  5. for遍历用例数据时,报错:TypeError: list indices must be integers, not dict,'int' object is not iterable解决方法

    一:报错:TypeError: list indices must be integers, not dict for i in range(0,len(test_data)): suite.addT ...

  6. python报错 TypeError: string indices must be integers

    所以在读取字典的时候,最好先判断类型,然后再查看它是否已经有这样的属性: type(mydict) == type({})             #检查不是字典 如果是字典,再看看有没有这样的属性: ...

  7. “TypeError: list indices must be integers or slices, not str”有关报错解决方案

  8. slice.indices()/collections.Counter笔记

    关于slice.indices() >>> help(slice) Help on class slice in module builtins: class slice(objec ...

  9. Python 列表

    python 列表 列表的特点 1.列表是一种可变的数据类型,这点是跟元组有区别的 2.列表中的值是有序的,并且可存放重复的值,这点跟set有区别的 3.python中的列表类似于其它语言中的数组 4 ...

随机推荐

  1. 戴尔iDRAC服务器远程控制设置

    对于远程的服务器,我们不能经常性的去机房维护,所以远程控制对于服务器来说就显得至关重要.那么你是用什么方式对服务器进行远程控制呢?远程桌面?还是KVM切换器?NO,你OUT了!如果你用的是戴尔的服务器 ...

  2. react-native redux 操作

    1.项目目录 2.redux (1)app/redux/action/action.js /** * 步骤一 * 行为 action */ // 定义行为名称 export const CHANGE_ ...

  3. 鸟哥的Linux私房菜-----1、Linux是什么与怎样学习Linux

  4. The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory的解决方法

    An error occurred at line: [31] in the generated java file: [/data/tmisnt/work/Catalina/localhost/_/ ...

  5. 【OI】Kruskal & ufs (克鲁斯卡与并查集)

    Kruskal是有关于最小生成树的算法. 这个算法非常好理解,用一句话来概括就是: 从小到大找不同集合的边. 那么,具体是怎样的呢. 1.先把所有顶点初始化为一个连通分量. 2.从所有边中选择最小的( ...

  6. Oracle利用游标返回结果集的的例子(C#)...(最爱)

    引用地址:http://www.alixixi.com/program/a/2008050727634.shtml   本例在VS2005+Oracle 92010 + WindowsXp Sp2测试 ...

  7. java多线程面试题(来自转载)

    在典型的Java面试中, 面试官会从线程的基本概念问起, 如:为什么你需要使用线程, 如何创建线程,用什么方式创建线程比较好(比如:继承thread类还是调用Runnable接口),然后逐渐问到并发问 ...

  8. Spring实战笔记

    晚上看了这本书的前面几章,记录一下自己看到的要点. 全书分为四大部分,Spring核心,web,后台相关,与其它框架集成.今天主要看了第一部分. Spring最根本的使命是简化Java开发,全方位的简 ...

  9. 洛谷 P1966 火柴排队 —— 思路

    题目:https://www.luogu.org/problemnew/show/P1966 首先,一个排列相邻交换变成另一个排列的交换次数就是逆序对数: 随便画一画,感觉应该是排个序,大的对应大的, ...

  10. VMware 虚拟机下挂载U盘

    1.首先设置虚拟机为连接的可移动U盘 2.首先在虚拟机界面的情况下,插入U盘,U盘格式为fat32的 3.在mnt目录下新建一个文件夹usb 4.运用sudo fdisk -l /dev/sdb 来查 ...