models icon indicating copy to clipboard operation
models copied to clipboard

Error importing string_int_label_map_pb2

Open jayshah19949596 opened this issue 9 years ago • 15 comments

When I run the object_detection_tutorial.ipynb i get the following error ImportError Traceback (most recent call last) in () ----> 1 from utils import label_map_util 2 3 from utils import visualization_utils as vis_util D:\Personal\learn\ML\DL\Tensorflow\Official-Tutorial\models-master\object_detection\utils\label_map_util.py in () 20 import tensorflow as tf 21 from google.protobuf import text_format ---> 22 from object_detection.protos import string_int_label_map_pb2 23 24 ImportError: cannot import name 'string_int_label_map_pb2'

I did run the following command : "C:\Program Files\protoc\bin\protoc" object_detection/protos/*.proto --python_out=.

but still error in importing string_int_label_map_pb2

jayshah19949596 avatar Sep 01 '17 08:09 jayshah19949596

I apologize but I am having a hard time understanding what the problem is, where the problem is, and what version it affects. Please resubmit and pay attention to the issue template (https://github.com/tensorflow/models/issues/new) . Please provide all the information it asks. Thank you.

michaelisard avatar Sep 01 '17 18:09 michaelisard

you can check your 'object/detection/protos' directory, checking if there is 'string_int_label_map_pb2.py'.The file was generated by command

protoc object_detection/protos/*.proto --python_out=.

shartoo avatar Sep 19 '17 03:09 shartoo

you can check your 'object/detection/protos' directory, checking if there is 'string_int_label_map_pb2.py'.The file was generated by command

protoc object_detection/protos/*.proto --python_out=.

Exactly what I was looking for. Thanks!

royjohal avatar May 28 '18 11:05 royjohal

I get the same issue: ImportError: cannot import name 'string_int_label_map_pb2'

However when checking the directory the file 'string_int_label_map_pb2' and others are present. (I ran the command as above)

Was following this tutorial, using Anaconda, Spyder https://pythonprogramming.net/introduction-use-tensorflow-object-detection-api-tutorial/

ghost avatar Aug 29 '18 16:08 ghost

@Coenbal did you solve the problem? I have the same issue. The scripts are present in the protos folder but the problem persists.

FilippoVannella avatar Oct 23 '18 10:10 FilippoVannella

I face the same issues and I'm using a macbook.

roya90 avatar Oct 24 '18 19:10 roya90

I am facing this issue "cannot import name 'string_int_label_map_pb2' " . I am struck here not knowing what to do. Please anyone help me in solving this issue.

I have gone through above discussion , but couldn't understand what it explains as I am new . This didn't statement "protoc object_detection/protos/*.proto --python_out=." , is what I am unable to understand. How to Run it in Win-10 to solve the issue.And what does it do...? Please help me in learning..! I use Win-10

harish-git08 avatar Dec 10 '18 13:12 harish-git08

@harish-git08 Follow the Step 2f. Compile Protobufs and run setup.py of this github: https://github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10

and finally run python setup.py build and python setup.py install from object_detection/research

joshuaomorales avatar Dec 13 '18 12:12 joshuaomorales

When I applied @shartoo 's solution it worked but I had to do that command from "/research" path.

heedoo avatar Jan 24 '19 21:01 heedoo

Tq so much

On Fri, Jan 25, 2019, 3:21 AM Heedoo Moon <[email protected] wrote:

When I applied @shartoo https://github.com/shartoo 's solution and worked but I had to do that command from "/research" path.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tensorflow/models/issues/2322#issuecomment-457370949, or mute the thread https://github.com/notifications/unsubscribe-auth/Aqoah0v0I9jFXThqe6ULbjHMwnR1NN5Xks5vGir7gaJpZM4PJ4Bp .

harish-git08 avatar Jan 25 '19 11:01 harish-git08

i am facing this issue in pycharm please help!

PreethmKumar avatar Mar 14 '19 12:03 PreethmKumar

from object_detection.protos import string_int_label_map_pb2

ImportError: cannot import name 'string_int_label_map_pb2'

THIS IS THE ERROR

PreethmKumar avatar Mar 14 '19 12:03 PreethmKumar

@PreethmKumar As shown above, 2322#issuecomment-446956766, and You should install protoc first. Then run this command in your bash or cmd :

protoc object_detection/protos/string_int_label_map.proto --python_out=.

potoo0 avatar Mar 31 '19 08:03 potoo0

Closing this issue since it's resolved. Feel free to reopen if the issue still persists. Thanks!

ymodak avatar Jul 19 '19 19:07 ymodak

Simply, go to protos dirctory in object detection folder in your pc and put this python file into the it: https://github.com/datitran/object_detector_app/blob/master/object_detection/protos/string_int_label_map_pb2.py

Mehran970 avatar May 16 '20 05:05 Mehran970