How to prepare a model in C ++ using tensor flow?

I tried to prepare an experiment with a deep learning model. I have found that tensor flow is the best way to do this. But there is a problem that tensor flow needs to be written in python. And my program contains many cycles. Like this..

for i=1~2000 for j=1~2000 

I know this is a big flaw for python. It is very slow than c. I know that tensorfow has a C ++ API, but that is not clear. https://www.tensorflow.org/api_docs/cc/index.html (This is the worst spec I have ever seen) Can someone give me an easy example? All I need are two simple codes. One of them is creating a schedule. Another way to download this chart and run it. I really want this. Hope someone can help me.

+6
source share
1 answer

It is not so simple, but it is possible. First, you need to create a graph graph graph graph in python and save it in a file. This article can help you https://medium.com/jim-fleming/loading-a-tensorflow-graph-with-the-c-api-4caaff88463f#.krslipabt

Secondly, you need to compile libtensorflow, associate it with your program (you also need the headers of the tensor flows, so this is a bit complicated) and load the graph from the file. This article can help you this time.
https://medium.com/jim-fleming/loading-tensorflow-graphs-via-host-languages-be10fd81876f#.p9s69rn7u

+4
source

All Articles