如何编译运行tensorflow的demo

本文介绍了如何编译和运行TensorFlow的demo。首先,需要安装编译工具bazel,参照官方教程进行安装。然后,配置TensorFlow的编译环境,运行configure文件。接着,编译TensorFlow动态库,使用bazel build命令。编译完成后,可以在指定目录找到libtensorflow_cc.so动态库。最后,编译并运行c++的demo,执行bazel build命令生成可执行程序,并展示运行结果。
摘要由CSDN通过智能技术生成

1.安装编译工具bazel,具体可以参照官方教程。
https://docs.bazel.build/versions/master/install-ubuntu.html
2. 配置tensorflow的编译环境
运行tensorflow目录下的configure文件,根据自己的环境进行配置。比如下面这样:

**root@fly-virtual-machine:/home/share/tensorflow# ./configure** 
Please specify the location of python. [Default is /root/anaconda3/bin//python]: /root/anaconda3/bin/python
**Do you wish to use jemalloc as the malloc implementation? (Linux only) [Y/n] y**
jemalloc enabled on Linux
**Do you wish to build TensorFlow with Google Cloud Platform support? [y/N] n**
No Google Cloud Platform support will be enabled for TensorFlow
**Do you wish to build TensorFlow with Hadoop File System support? [y/N] n**
No Hadoop File System support will be enabled for TensorFlow
**Do you wish to build TensorFlow with the XLA just-in-time compiler (experimental)? [y/N] n**
No XLA JIT support will be enabled for TensorFlow
Found possible Python lib
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值