ModuleNotFoundError: No module named 'utils'

add object_detection to the front of utils:

# from utils import label_map_util
# from utils import visualization_utils as vis_util

from object_detection.utils import label_map_util
from object_detection.utils import visualization_utils as vis_util

What folder are you running your python script from?

To be able to access the 'utils' module directly, you need to be running the script inside the <models-master>\research\object_detection folder.


  • Instead of running script inside object detection folder append the path of tensorflow object detection in your script by writing

    import sys
    
    sys.path.append('PATH_TO_TENSORFLOW_OBJECT_DETECTION_FOLDER')
    
  • e.g 'PATH_TO_TENSORFLOW_OBJECT_DETECTION_FOLDER' in my ubuntu system is

    /home/dc-335/Documents/Softwares/tensorflow/models/research/object_detection

  • Cheers, You done it !!