本文介绍了无法从“object_detection"导入名称“model_lib_v2"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试训练 TF2 进行对象检测.当我运行model_main_tf2.py时,出现以下错误:

I'm trying to train TF2 for object detection. When I run model_main_tf2.py, I get the following error:

Traceback (most recent call last):
  File "C:\Python_venv\trained_models\model_main_tf2.py", line 32, in <module>
    from object_detection import model_lib_v2
ImportError: cannot import name 'model_lib_v2' from 'object_detection' (c:\Python_venv\tensorflow\lib\site-packages\object_detection\__init__.py)

如何安装 model_lib_v2?

How do I install model_lib_v2?

我尝试重新安装 TF 并重新安装 TensorFlow-object-detection-API,但没有成功.我在网上到处寻找答案.

I tried reinstalling TF and reinstalling TensorFlow-object-detection-API but no luck. I went all over the internet looking for answers.

我发现:https://github.com/tensorflow/models/issues/7920但是他们没有说如何安装model_lib_v2

I found:https://github.com/tensorflow/models/issues/7920But they don't say how to install model_lib_v2

很遗憾我不能使用 TF1,目标是使用 TF2.

Unfortunately I cannot use TF1, the goal is to use TF2.

推荐答案

简单复制 https://github.com/vertok/models/tree/master/research/object_detection 电脑上的文件夹,一切正常;)

Simply copy https://github.com/vertok/models/tree/master/research/object_detection folder on you pc and everything works;)

这篇关于无法从“object_detection"导入名称“model_lib_v2"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 21:24