iOS_Tensorflow_ObjectDetection_Example icon indicating copy to clipboard operation
iOS_Tensorflow_ObjectDetection_Example copied to clipboard

Issues in string_int_label_map.pb

Open richard-ash opened this issue 8 years ago • 11 comments

First, awesome project! 😁

Getting a couple errors with the string_int_label_map.pb files included in your project.

First is:

#if 3003002 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers.  Please
#error regenerate this file with a newer version of protoc.
#endif

Second is: No member named 'Shutdown' in 'object_detection::protos::StringIntLabelMapItemDefaultTypeInternal' for:

void TableStruct::Shutdown() {
  _StringIntLabelMapItem_default_instance_.Shutdown();
  delete file_level_metadata[0].reflection;
  _StringIntLabelMap_default_instance_.Shutdown();
  delete file_level_metadata[1].reflection;
}

It seems that these files should've been regenerated when I built tensorflow, but I can't find them in the gen directory.

Any ideas?

Thanks!

richard-ash avatar Oct 07 '17 18:10 richard-ash

For the first question, it seems like you installed several protobuf and use the wrong one.

Currently TensorFlow is using the protobuf 3.1.0, so try to remove other versions of protobuf in your computer. The link of how to install the protobuf is here: https://www.tensorflow.org/versions/r0.12/get_started/os_setup#protobuf_library_related_issues

JieHe96 avatar Oct 09 '17 23:10 JieHe96

Thanks!

richard-ash avatar Oct 10 '17 21:10 richard-ash

git checkout e3ceea3f6

Try use this commit version of TensorFlow and it should work correctly.

JieHe96 avatar Oct 22 '17 21:10 JieHe96

@JieHe96 i did as you said as it is still not working. Can't you link your .proto file so we can generate the conflicting file again?

ps : after some more reading it appears in the ios code you are checking the version for "3003002 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION" You also checking the other around, not less than 3.3.0. So 3.1 is a no-go

tirrorex avatar Nov 09 '17 10:11 tirrorex

same error, seems it needs 3.3, but on https://www.tensorflow.org/versions/r0.12/get_started/os_setup you will find only 3.1

did someone solve this issue?

anonym24 avatar Dec 15 '17 10:12 anonym24

same error +1

zwhinmedia avatar Dec 19 '17 09:12 zwhinmedia

I solved this problem by cloning the 1.4.0 tensorflow tag. Then after doing all the normal TF compile steps, by recompiling the protbuff headers with protoc version 3.4.0.

If you check the version of protobuff common that gets included with the 1.4.0 TF tag its Protobuf 3.4.0.

Get the correct 3.4.0 binary for your system here: https://github.com/google/protobuf/releases

Get the original .proto definition file here: https://github.com/tensorflow/models/blob/master/research/object_detection/protos/string_int_label_map.proto

Then run something like: ./protoc --cpp_out=./ ./string_int_label_map.proto

Make sure to use the protoc binary for 3.4.0 that you downloaded above. Then replace the files in the ex_SSD_Mobilenet_TF folder: string_int_label_map.pb.cc string_int_label_map.pb.h

I might make a PR that provides these changes so others don't have to mess around so much.

madhavajay avatar Jan 12 '18 14:01 madhavajay

@madhavajay thanks for telling us, I'll try at work time later, would be great if you make a PR

anonym24 avatar Jan 13 '18 18:01 anonym24

😊 @anonym24 I already did: https://github.com/JieHe96/iOS_Tensorflow_ObjectDetection_Example/pull/24

madhavajay avatar Jan 14 '18 21:01 madhavajay

@madhavajay do I still need to change something in original tensorflow folder? like this screenshot at jan 30 11-14-24

There are many points and instructions here, but where to start, what is the obligation to carry out

anonym24 avatar Jan 30 '18 09:01 anonym24

@madhavajay solved it, big thanks!

didn't need it to change anything in tensorflow 1.4.0 files

I just installed protobuf 1.4.0 downloaded your edited iOS_Tensorflow_ObjectDetection_Example downloaded tensorflow 1.4.0

and only did this

export TF_ROOT=/your//tensorflow/root/
bash config.sh
cd $TF_ROOT
tensorflow/contrib/makefile/build_all_ios_ssd.sh

and it worked!

anonym24 avatar Jan 30 '18 11:01 anonym24