运行YOLO出错:TypeError: No loop matching the specified signature and casting was found for ufunc greater

运行YOLOv7模型,出现下图报错信息:

代码报错:

# cum_counts = np.cumsum(np.greater(counts, 0, dtype=np.int32))

原因一:某些库的版本过高。

官方要求版本:

 而我的版本:

numpy                                                  1.24.3

protobuf                                                4.23.2

解决方法:

更新库的的版本:

pip install -r requirements.txt

原因二:未找到与指定签名匹配的循环,并且未找到ufunc大于

临时解决方法:

删掉dtype=np.int32,即把改行代码修改为:

cum_counts = np.cumsum(np.greater(counts, 0))

猜你喜欢

转载自blog.csdn.net/weixin_45819759/article/details/131229983
今日推荐