1 Star 0 Fork 1

loean / tensorflow_cpp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Tensorflow examples for C/C++

This project includes source code for my blog:

  1. Tensorflow C: from training to serving (In Chinese)

  2. Tensorflow C++: from training to serving (In Chinese)

1. Dependancies

  1. 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.

  2. 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.

2. Build

Prepare

mkdir build
cd build

CMake

For C API, run:

cmake .. -DUSE_TENSORFLOW_C=ON

For C++ API, run:

cmake .. -DUSE_TENSORFLOW_CPP=ON

Build

make

3. Run

For C++ Example (Simple Net)

./load_simple_net ../simple/model/simple.pb

For C++ Example (CNN Net)

./load_predict_cnn ../fashion_mnist/models/fashion_mnist.h5.pb ../fashion_mnist/fashion_0.png

For C Example (Simple Net)

./load_simple_net_c_api ../simple/model/simple.pb

For C Example (CNN Net)

./load_predict_cnn_c_api ../fashion_mnist/models/fashion_mnist.h5.pb ../fashion_mnist/fashion_0.png

Contact

My Blog: www.liuxiao.org

If you have any question, please contact liuxiao at foxmail.com

空文件

简介

C and C++ examples for tensorflow 展开 收起
C++
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C++
1
https://gitee.com/liuzc/tensorflow_cpp.git
git@gitee.com:liuzc/tensorflow_cpp.git
liuzc
tensorflow_cpp
tensorflow_cpp
master

搜索帮助