mac 安装 tensorflow

来源:互联网 发布:小米3怎么用4g网络 编辑:程序博客网 时间:2024/06/05 06:14

到tensorflow的官https://www.tensorflow.org/

在最上方选择install


其中列出了几种安装途径,官方推荐的是virtualenv,并在下方列出了安装代码。


$ sudo easy_install pip $ sudo pip install --upgrade virtualenv 

选择本机python版本:

$ virtualenv --system-site-packages targetDirectory # for Python 2.7 $ virtualenv --system-site-packages -p python3 targetDirectory # for Python 3.n 

 you must activate the virtualenv environment each time you use TensorFlow in a new shell. If the virtualenv environment is not currently active (that is, the prompt is not (tensorflow), invoke one of the following commands:

$ source ~/tensorflow/bin/activate # bash, sh, ksh, or zsh$ source ~/tensorflow/bin/activate.csh # csh or tcsh

使用:1.启动tensorflow 2.通过编辑--image_file=图片路径识别新的图片

Clone the TensorFlow repository  tensorflowC++/tensorflow 中

解决build should within a workspqce 
  1. mkdir tensorflow  
  2. cd tensorflow  
  3. touch WORKSPACE  
 若使用C++api,应当先在当前终端运行./configure.在用bazel run