terryzhao127 / tensorflow-windows-build-script

A script to automate building Tensorflow on Windows and solve some problems
GNU General Public License v3.0
102 stars 35 forks source link

Use of built C++ API #4

Closed ghost closed 5 years ago

ghost commented 5 years ago

I have used your script and thanks to it I have finally successfully built TensorFlow v1.12 C++ API on Windows. The problem is that I haven't got enough clues on how to use this API. I've got libtensorflow_cc.so, libtensorflow_cc.so.if.lib, and also all kinds of other libs. However, my original project based on tensorflow 1.6 requires tf_cc.lib and tf_framework.lib.

What I do then is following this comment. I noticed that it successfully helped me to build a project. However, I'm wondering that is this a necessary step? If it is, will it help if you integrate this as an example in your repository?

By the way, you have hard coded visual studio 2015 in building protobuf.

terryzhao127 commented 5 years ago

However, my original project based on tensorflow 1.6 requires tf_cc.lib and tf_framework.lib.

tf_framework.lib is likely to be built with another API called libtensorflow_framework.so. But I have no idea what it really is. Maybe you can have a try to build with this and give me feedback or directly send a pull request.

I noticed that it successfully helped me to build a project. However, I'm wondering that is this a necessary step?

Now no official developers or maintainers have gave me a right way to use the built C++ API. They said the external dependencies are directly linked if you have linked the libtensorflow_cc.so.if.lib. But that doesn't work!

If it is, will it help if you integrate this as an example in your repository?

I have been considering offering an example. Now you could use this gist to get necessary things for you. However, other sources of external dependencies should be included by yourself.

By the way, you have hard coded visual studio 2015 in building protobuf.

I have found that the source of protobuf is just in bazel-source\external\protobuf_archive\src\. And I will delete this API that builds protobuf.

ghost commented 5 years ago

Thank you for your reply. I noticed that you have been working on this topic for quite a while, so I guess there won't be better way to use TensorFlow C++ API on Windows at least for now. I would appreciate it if your could offer latest news concerning this topic in your repositories.

terryzhao127 commented 5 years ago

Nice idea! I am sure my project will be adapted to the latest changes of Tensorflow in several months.

BTW, are your problems solved?

ghost commented 5 years ago

I am now struggling with debugging. My program just raises errors in NewSession(), and it's hard to debug as .pdb doesn't come with tensorflow. Same piece of code worked under tensorflow 1.6.0 built with CMake, so I guess something still goes wrong in my configuration.

terryzhao127 commented 5 years ago

Give me your code. I want to have a try. I will probably encounter same problem as yours.

ghost commented 5 years ago

It's really nice for you to say so. However, my code have dependencies on other libraries and specific data format. I'll see if I can extract the tensorflow part alone, or else there would be a lot of unnecessary work to configure the project.

terryzhao127 commented 5 years ago

That’s fine.

terryzhao127 commented 5 years ago

Closed due to inactivity.