TypeError: object of type class numpy.float64 cannot be safely interpreted as an integer.

运行别人在pytorch上实现的目标检测模型Faster-RCNN时,突然报了这个错误:
TypeError: object of type <class ‘numpy.float64’> cannot be safely interpreted as an integer.

查看了一下自己的numpy版本,发现是1.18.1,可能是版本过新的问题,所以尝试将numpy版本降到1.16。

pip install numpy==1.16

就OK了。

猜你喜欢

转载自blog.csdn.net/qq_35268841/article/details/106774951