JieHe96 / iOS_Tensorflow_ObjectDetection_Example

An iOS application of Tensorflow Object Detection with different models: SSD with Mobilenet, SSD with InceptionV2, Faster-RCNN-resnet101
129 stars 28 forks source link

Issues in string_int_label_map.pb #11

Open richard-ash opened 6 years ago

richard-ash commented 6 years ago

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!

JieHe96 commented 6 years ago

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

richard-ash commented 6 years ago

Thanks!

JieHe96 commented 6 years ago
git checkout e3ceea3f6

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

tirrorex commented 6 years ago

@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

anonym24 commented 6 years ago

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?

zwhinmedia commented 6 years ago

same error +1

madhavajay commented 6 years ago

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.

anonym24 commented 6 years ago

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

madhavajay commented 6 years ago

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

anonym24 commented 6 years ago

@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 commented 6 years ago

@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!