models icon indicating copy to clipboard operation
models copied to clipboard

string_int_label_map_pb2 issue

Open 10183308 opened this issue 9 years ago • 12 comments

hello all,

when i run the create_pascal_tf_record.py,it shows that

from protos import string_int_label_map_pb2

ImportError: cannot import name string_int_label_map_pb2

i want to konw where is the string_int_label_map_pb2 ?

thank you very much

10183308 avatar Jun 19 '17 02:06 10183308

I had the same issue. The protobuf libraries need to be compiled protoc object_detection/protos/*.proto --python_out=. you will have to install protoc first though. Look in the installation instructions for other things to do before running.

danzelmo avatar Jun 19 '17 02:06 danzelmo

thank you very much ,

but when I run the commond ,it shows anthoer worng, hc@hc-PC:/media/media_share/linkfile/models$ protoc object_detection/protos/*.proto --python_out=. object_detection/protos/anchor_generator.proto:11:3: Expected "required", "optional", or "repeated". object_detection/protos/anchor_generator.proto:11:32: Missing field number.

what is wrong ?

Could you help me?

thank you very much

10183308 avatar Jun 19 '17 03:06 10183308

I am not sure what is wrong in your specific example. This type of question is also better suited to stackoverflow, you can ask, there and may get more responses.

danzelmo avatar Jun 19 '17 03:06 danzelmo

Solved by updating protobuf

L-CY avatar Jun 19 '17 06:06 L-CY

@10183308 as mentioned, this issue is most likely caused an outdated version of the protobuf compiler. You can download a more recent version of the protobuf compiler here: https://github.com/google/protobuf/releases

We recommend using protobuf 2.6.1 or higher.

derekjchow avatar Jun 19 '17 19:06 derekjchow

Should the object detection tutorial mention the installation in the beginning? Issues #1562, #1591, #1595 and this one are all related to not knowing that such installation (especially the Protobuf compilation step) is required. This would make the tutorial clearer and avoid future confusion.

korrawat avatar Jun 20 '17 05:06 korrawat

@danzelmo your comment fixed the issue for me. @korrawat I do agree these commands should be in the README.

arnaudmiribel avatar Jun 20 '17 12:06 arnaudmiribel

But when i do... "protoc object_detection/protos/*.proto--python_out=." The terminal responds as "Missing output directives."

JaydipB94 avatar Jun 29 '17 17:06 JaydipB94

You to add a space. Use protoc object_detection/protos/*.proto --python_out=. instead of protoc object_detection/protos/*.proto--python_out=.

danzelmo avatar Jun 29 '17 20:06 danzelmo

Thanks @danzelmo, problem solved!

JaydipB94 avatar Jun 29 '17 21:06 JaydipB94

Looks like the installation instructions on the object detection tutorial do include a mention of the Protobuf requirement. Closing this issue.

alive-zk avatar Jun 30 '17 18:06 alive-zk

You to add a space. Use protoc object_detection/protos/*.proto --python_out=. instead of protoc object_detection/protos/*.proto--python_out=.

Hi, I have the same problem and I did as you said : now I have the file string_int_label_map_pb2, in the right place, but he still says that he can not find it :/

ImportError: cannot import name 'string_int_label_map_pb2'

Do you have any idea?

Bastien123 avatar Dec 08 '18 03:12 Bastien123