成功解决from nets import inception_resnet_v2 ModuleNotFoundError: No module named 'nets'

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_41185868/article/details/82891217

解决问题

Traceback (most recent call last):
  File "object_detection/builders/model_builder_test.py", line 23, in <module>
    from object_detection.builders import model_builder
  File "F:\File_Python\Python_example\models-master\research\object_detection\builders\model_builder.py", line 35, in <module>
    from object_detection.models import faster_rcnn_inception_resnet_v2_feature_extractor as frcnn_inc_res
  File "F:\File_Python\Python_example\models-master\research\object_detection\models\faster_rcnn_inception_resnet_v2_feature_extractor.py", line 28, in <module>
    from nets import inception_resnet_v2
ModuleNotFoundError: No module named 'nets'

解决思路

Windows系统环境时,安装TF-silm库,使用遇到的问题

解决方法

依次执行下边两条语句

python setup.py build
python setup.py install
F:\File_Python\Python_example\models-master\research\slim>python setup.py build
running build
running build_py
creating build

……

reading manifest file 'slim.egg-info\SOURCES.txt'
writing manifest file 'slim.egg-info\SOURCES.txt'

F:\File_Python\Python_example\models-master\research\slim>python setup.py install
running install
running bdist_egg

……

Copying slim-0.1-py3.6.egg to f:\program files\python\python36\lib\site-packages
Adding slim 0.1 to easy-install.pth file

Installed f:\program files\python\python36\lib\site-packages\slim-0.1-py3.6.egg
Processing dependencies for slim==0.1
Finished processing dependencies for slim==0.1

大功告成!

猜你喜欢

转载自blog.csdn.net/qq_41185868/article/details/82891217