Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Exception has occurred: ImportError cannot import name 'string_int_label_map_pb2' from 'object_detection.protos'

I am facing import error in this code please help me out it is in label map utility function i dint need code to fix it i need how to solve this import error.

"""Label map utility functions."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import collections
import logging
import sys
sys.path.append('models/research/object_detection')
import numpy as np
from six import string_types
from six.moves import range
import tensorflow.compat.v1 as tf
from google.protobuf import text_format
import object_detection
from object_detection.protos import string_int_label_map_pb2

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

You just need to put that files in the same folder and just write

import string_int_label_map_pb2

instead of

from object_detection.protos import string_int_label_map_pb2

Also make sure you have converted protos files to .py file.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading