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

 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. 使用maven时,如何修改JVM的配置参数;maven命令执行时到底消耗多少内存?

    maven是使用java启动的,因此依赖JVM,那么如何修改JVM参数? MAVEN_OPTS 在系统的环境变量中,设置MAVEN_OPTS,用以存放JVM的参数,具体设置的步骤,参数示例如下: MA ...

  2. yarn-cli 缓存

    yarn cache list Yarn 会在你的用户目录下开辟一块全局缓存用以保存下载的包.yarn cache list 用于列出所有已经缓存的包. yarn cache dir 执行 yarn ...

  3. IOS View编程指南笔记

    我们所示程序 对于一切IOS APP来说.我们看的的内容,都是UIView所呈现的. UIView如场景,UIWindow如舞台.UIView粉墨登场在UIWindow这个舞台上,使我们看到丰富多彩的 ...

  4. js类继承扩展super

    相应的资料https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/super 例子: class Pol ...

  5. Cocos2D-X2.2.3学习笔记12(瞬时动作)

    watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaHVjYmxvZw==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA ...

  6. Gif验证码类

    package com.paic.bics.common.utils.vcode; import java.awt.AlphaComposite; import java.awt.Color; imp ...

  7. 李维对VCL理解的几个错误

    研读深入浅出VCL一书的时候,有不少地方被网友提出疑问,而且似乎是网友们正确.但这丝毫不动摇李维在大中华Delphi界的江湖地位,因为高手应该是对整个系统理解的高手,而不是对某一个疑问的高手.能花巨量 ...

  8. Codeforces Round #311 (Div. 2)C. Arthur and Table

    C. Arthur and Table time limit per test 1 second memory limit per test 256 megabytes input standard ...

  9. Flask的多app应用,多线程如何体现

    一.多app应用 在一个py文件中创建多个Flask的app对象 from werkzeug.wsgi import DispatcherMiddleware from werkzeug.servin ...

  10. 29. ExtJs - Struts2 整合(1) - 登录页面

    转自:https://yarafa.iteye.com/blog/729197 初学 ExtJS,在此记录下学习过程中的点点滴滴,以备不时只需,也希望能给跟我一样的菜鸟一些帮助,老鸟请忽略.如有不当之 ...