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

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

posted @ 2017-07-29 14:38  as3asddd  阅读(527)  评论(0编辑  收藏  举报