Object Detection Api安装经测试后,出现“AlreadyExistsError: Another metric with the same name already exists.”

在安装Object Detection Api后,经过如下一行代码测试:

from object_detection.builders import model_builder

出现如下错误:

AlreadyExistsError: Another metric with the same name already exists.

如图:
在这里插入图片描述
在网上寻找解决问题的方案,发现有一处解释合理,运行后也解决问题了。

链接1: Stack Overflow.
链接2: 关于AlreadyExistsError: Another metric with the same name already exists.的解决方案.

大致意思是:Keras 版本与 Tensorflow 版本不匹配。

我装的是python3.8和tensorflow2.6,而在装的过程中,keras默认装成keras2.7版本了,所以版本不匹配。

解决方法:
通过如下代码,先卸载掉keras,

pip uninstall keras

然后在通过如下代码,再次安装keras2.6版本。

pip install keras==2.6.0

最后,经验证,无误!如下图。
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_44359479/article/details/121236331