tensorflow 安装

官网上提供了tensorflow的ubutun和window下的安装,这里先介绍windows

https://tensorflow.google.cn/install/source_windows

1、install python and package

Install a Python 3.5.x or Python 3.6.x 64-bit release for Windows(我选择的是3.6)

pip install  package

pip3 install six numpy wheelpip3 install keras_applications==1.0.6 --no-depspip3 install keras_preprocessing==1.0.5 --no-deps

2、install bazel

Download Bazel for Windows from GitHub.:https://github.com/bazelbuild/bazel/releases

you will get bazel****.exe  and better change it to bazel.exe

3、install msys2

Download msys2 for windons:https://www.msys2.org/

run command to set patch:

pacman -S git patch unzip

4、Install Visual C++ Build Tools(我选择的是2017)

Download vs for windons:https://visualstudio.microsoft.com/zh-hans/vs/older-downloads/?rr=https%3A%2F%2Ftensorflow.google.cn%2Finstall%2Fsource_windows

5、Edit environment variables.

  1. Edit Path. Add new entries to the beginning of the list:
    • The directory of bazel.exe. (Example: c:\bazel).
    • The usr\bin directory of MSYS2. (Example: c:\msys64\usr\bin).
    • If you will build Python code: the directory of python.exe. (Example: c:\python3).
  2. Add BAZEL_SH. Its value must be the path to MSYS2 Bash. Example: c:\msys64\usr\bin\bash.exe
  3. Add JAVA_HOME (if you will build Java code). Its value must be the directory where you installed the Java JDK 8, for example C:\Program Files\Java\jdk1.8.0_152

6、get tensorflow code and config

git clone https://github.com/tensorflow/tensorflow.gitcd tensorflow git checkout branch_name  # r1.9, r1.10, etc.
 python ./configure.py

7、bazel build freeze_graph and toco

bazel build tensorflow/python/tools:freeze_graph  (it is a long time)

bazel build //tensorflow/contrib/lite/toco:toco

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值