Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: cannot import name 'string_int_label_map_pb2'

I compiled the files with the following command.

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

and as a result compiled into .py files.

However, I received the following error code.

~/Documents/imgmlreport/inception/classification_inception/models/research/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'

so i checked utils and i already had a string_int_label_map_pb2.py

why can't import string_int_label_map_pb2.py ?

like image 906
송준석 Avatar asked Apr 25 '18 04:04

송준석


1 Answers

Are you using a conda environment?

In that case the protoc folder that is pointing is in C:\Users\xx\anaconda3\envs\xx\Lib\site-packages\protos

You should copy the content of protoc from Models\reserach into this one

like image 121
isaac0 Avatar answered Sep 25 '22 11:09

isaac0