简体   繁体   中英

TensorfFlow Object-detection API - ModuleNotFoundError: No module named 'object_detection'

installed properly (following instructions https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/training.html ) on MACos, still I keep getting this MNFE when running a script;

Traceback (most recent call last):
  File "generate_tfrecord.py", line 29, in <module>
    from object_detection.utils import dataset_util, label_map_util
ModuleNotFoundError: No module named 'object_detection'

anyone else facing the same issue? Found a lot on windows, not for mac.

Use these lines at the very beginning of your script:

import sys
sys.path.extend([
r'path\to\models\research\object-detection',
r'path\to\models\research\tf_slim',
r'path\to\models\research',
r'path\to\models',
])

These must be ran before this line:

from object_detection.utils import dataset_util, label_map_util

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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