Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trial to support v2.13.0 #5

Closed
BBO-repo opened this issue Jul 25, 2023 · 2 comments · Fixed by #6
Closed

trial to support v2.13.0 #5

BBO-repo opened this issue Jul 25, 2023 · 2 comments · Fixed by #6

Comments

@BBO-repo
Copy link

Hello,

Thank you for providing such a repository, definitively a must have for c++ developer wanting to play with IA!

I'm trying to have tensorflow C++ api build from source with latest v2.13.0 Tensorflow inspiring from your docker file and could successfully compile tensorflow but I'm facing some issues at runtime executing hello-tensorflow

To build v2.13.0 with gpu support I've made a docker container using the official build images FROM tensorflow/build:2.13-python3.11
Then inside the container run:
git clone --branch v2.13.0 --depth=1 https://github.com/tensorflow/tensorflow.git

Export all the env vars PYTHON_BIN_PATH, PYTHON_LIB_PATH ... CC_OPT_FLAGS, TF_SET_ANDROID_WORKSPACE as it is done in your docker file (line 43-52) and run the ./configure and finally run
bazel build --jobs 8 --config=cuda --config=opt --config=monolithic --verbose_failures tensorflow:libtensorflow_cc.so tensorflow:install_headers;
which allow to successfully build tensorflow

Then I compiled protobuf from source using https://github.com/protocolbuffers/protobuf/archive/v3.21.9.zip using same steps of your docker file (line 81-93)

I could then compile the hello-tensorflow with a
g++ hello-flow.o -lprotobuf -L/my/path/lib/tensorflow -ltensorflow_cc -ltensorflow_framework

The issues I faced are:

  1. I've got to link with -ltensorflow_framework whereas I used --config=monolithic
  2. when running ./hello-tensorflow I got this error
[libprotobuf ERROR external/com_google_protobuf/src/google/protobuf/descriptor_database.cc:642] File already exists in database: google/protobuf/any.proto
[libprotobuf FATAL external/com_google_protobuf/src/google/protobuf/descriptor.cc:1986] CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size): 
terminate called after throwing an instance of 'google::protobuf::FatalException'
  what():  CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size): 
Aborted (core dumped)

I was wondering if you would have any suggestion to address those issues?
And if you would have any plan to support TensorFlow v2.13.0 I would be happy to help.

Regards.

@lreiher
Copy link
Member

lreiher commented Aug 8, 2023

Thank you for your interest in our project and sorry for the delayed response!

We have now finally been able to also play around a bit with building 2.13.0. I have just created new PR #6 for supporting 2.13.0. It should get merged and the libraries should get released tomorrow, if all goes well.

Thank you also for your input as to what you have tried so far. As to why your trial might not have worked: I think you need to switch to a non-monolithic build due to tensorflow/tensorflow#59081.

@BBO-repo
Copy link
Author

Hello,
Thanks for your answer and no problem for the delay.
Then with your new PR all good!
I'll still check tensorflow/tensorflow#59081 just for curiosity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants