天天看點

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

解決問題

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

大功告成!