简体   繁体   English

ModuleNotFoundError:没有名为“nets”的模块(TensorFlow)

[英]ModuleNotFoundError: No module named 'nets' (TensorFlow)

Here is my error :这是我的错误:

File "C:\Program Files\Python36\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\models\faster_rcnn_inception_resnet_v2_feature_extractor.py", line 28, in <module>
ModuleNotFoundError: No module named 'nets'

screenshot截屏

I have already change the python path but it doesn't change anything我已经改变了 python 路径,但它没有改变任何东西

Maybe in a Windows environments, capital code couldn't check differently and differs from linux file system.也许在 Windows 环境中,大写代码无法进行不同的检查,并且与 linux 文件系统不同。

It has already BUILD file inside slim folder.它已经在 slim 文件夹中包含了 BUILD 文件。 Let's move BUILD to BUILD.old, then You can build slim package让我们将 BUILD 移动到 BUILD.old,然后您可以构建纤薄的包

c:\foo\bar\models\research> cd slim
c:\foo\bar\models\research\slim> move BUILD BUILD.old
c:\foo\bar\models\research\slim> python setup.py build
c:\foo\bar\models\research\slim> python setup.py install

on windows in the C:\\tensorflow\\models\\research\\slim directory run python setup.py build python setup.py install在 C:\\tensorflow\\models\\research\\slim 目录下的 windows 上运行 python setup.py build python setup.py install

PS models/research/slim HAS ITS OWN setup.py!!!!!!!!!!!!! PS模型/研究/超薄有自己的setup.py!!!!!!!!!!!!!!! use the one specific for slim使用一种专为苗条

You need to make sure that the tensorflow/models/research/ and slim directories are added to PYTHONPATH (see the installation instructions ).您需要确保将tensorflow/models/research/slim目录添加到 PYTHONPATH(请参阅安装说明)。

Either run the following要么运行以下

export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim

or add it to the end of your ~/.bashrc so that it gets run automatically whenever you open a new terminal.或将其添加到~/.bashrc的末尾,以便在您打开新终端时自动运行。

Try to copy nets or slim folder to .....\\site-packages\\object_detection-0.1-py3.5.egg尝试将 nets 或 slim 文件夹复制到 .....\\site-packages\\object_detection-0.1-py3.5.egg

See if this solution works.看看这个解决方案是否有效。

I met same problem with you, since we are both in Windows Environment.我和你遇到了同样的问题,因为我们都在 Windows 环境中。 What am I doing is that, I added little codes in the header of model_builder_test.py.我在做什么,我在model_builder_test.py 的标题中添加了一些代码。 import sys sys.path.append("....../tutorial/models/research") sys.path.append("....../tutorial/models/research/slim") ...... import tensorflow as tf from google.protobuf import text_format from object_detection.builders import model_builder ......

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM