This project includes source code for my blog:
Tensorflow C: from training to serving (In Chinese)
Tensorflow C++: from training to serving (In Chinese)
For C API, download sdk from https://www.tensorflow.org/install/lang_c and put it into third_party/tensorflow_cpu (default) or third_party/tensorflow_gpu folder.
For C++ API, follow the steps in Tensorflow C++: from training to serving (In Chinese) or Tensorflow C++ API to build tensorflow on your platform.
The C++ API is only designed to work with TensorFlow bazel build, which means you have to build tensorflow on every devices. If you need a stand-alone option, we suggest you use the C API.
mkdir build
cd build
For C API, run:
cmake .. -DUSE_TENSORFLOW_C=ON
For C++ API, run:
cmake .. -DUSE_TENSORFLOW_CPP=ON
make
./load_simple_net ../simple/model/simple.pb
./load_predict_cnn ../fashion_mnist/models/fashion_mnist.h5.pb ../fashion_mnist/fashion_0.png
./load_simple_net_c_api ../simple/model/simple.pb
./load_predict_cnn_c_api ../fashion_mnist/models/fashion_mnist.h5.pb ../fashion_mnist/fashion_0.png
My Blog: www.liuxiao.org
If you have any question, please contact liuxiao at foxmail.com
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。