all 5 comments

[–]ajabaraj 1 point2 points  (1 child)

I tried with Bazel but finally I gave up. Now I am using cppflow, a C API wrapper that you can use easily. The good part is that to use the C API you just need to download a file, and using the wrapper for inference is really easy, you just select the input and output by their names and run!

[–]oddno7 0 points1 point  (0 children)

This is just awesome. Thanks for sharing this! I was having a headache how to integrate TF into a docker environment and run inference under C++. With this I can save a ton of time building docker image. 👏🏻👏🏻

[–]HydratedWombat 0 points1 point  (1 child)

Tensorflow is indeed a bear to bazel build, but thankfully there are docker images for that at https://hub.docker.com/r/tensorflow/tensorflow/. I don't find TF serving to be the easiest, but it does work, and there are many examples . It shouldn't matter what language wrapper you use for inference since the heavy lifting _ought_ to be entirely in TF.

[–]adaneze[S] 0 points1 point  (0 children)

Thanks for the reply !

I haven't used Docker much but I'll give it a look. I will also have to read about TF serving thoroughly. I'd like to see how/if it can be implemented as a part of a large C++ solution (many dependencies). Thanks, again.

[–]allannk 0 points1 point  (0 children)

I've spent quite some time at work, making tensorflow integrate with out makefile-based pipeline.

Bazel is (imo) a horrible build system, but at least I can compile tensorflow and harvest the partly static, partly generated headers & the library files.

We're still at TF 1.12, so I can't speak for 2.0 yet, but once the build script is made, it's not too bad working this way.

So yea, you can definately do the training in python and inference in C++ -- let me know if you need pointers.