初入Tensorflow一览(1)
来源:互联网 发布:数据采集与处理期刊 编辑:程序博客网 时间:2024/06/05 10:35
1. 安装Tensorflow
2. 安装方式
3. 安装步骤
3.1 安装virtualenv工具。
$ sudo pip install --upgrade virtualenv
3.2 为tensorflow创建环境目录
$ virtualenv --system-site-packages ~/tensorflow$ cd ~/tensorflow
3.3 进入virtualenv环境并安装tensorflow
本人是在VPN环境下安装的,不知道非VPN环境是否被墙
[wai@waideMacBook ~/tensorflow]$cd bin/
[wai@waideMacBook ~/tensorflow/bin]$source activate
(tensorflow) [wai@waideMacBook ~/tensorflow/bin]$pip install --upgrade tensorflow
Collecting tensorflow
Downloading tensorflow-1.3.0-cp27-cp27m-macosx_10_11_x86_64.whl (39.4MB)
100% |████████████████████████████████| 39.4MB 20kB/s
Collecting six>=1.10.0 (from tensorflow)
Using cached six-1.10.0-py2.py3-none-any.whl
中间省去各种 Collecting...
Building wheels for collected packages: html5lib, markdown
Running setup.py bdist_wheel for html5lib ... done
Stored in directory: /Users/wai/Library/Caches/pip/wheels/6f/85/6c/56b8e1292c6214c4eb73b9dda50f53e8e977bf65989373c962
Running setup.py bdist_wheel for markdown ... done
Stored in directory: /Users/wai/Library/Caches/pip/wheels/bf/46/10/c93e17ae86ae3b3a919c7b39dad3b5ccf09aeb066419e5c1e5
Successfully built html5lib markdown
Installing collected packages: six, protobuf, backports.weakref, numpy, werkzeug, html5lib, markdown, bleach, tensorflow-tensorboard, funcsigs, pbr, mock, tensorflow
Found existing installation: six 1.4.1
Not uninstalling six at /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python, outside environment /Users/wai/tensorflow
Found existing installation: numpy 1.8.0rc1
Not uninstalling numpy at /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python, outside environment /Users/wai/tensorflow
Successfully installed backports.weakref-1.0rc1 bleach-1.5.0 funcsigs-1.0.2 html5lib-0.9999999 markdown-2.6.9 mock-2.0.0 numpy-1.13.1 pbr-3.1.1 protobuf-3.4.0 six-1.10.0 tensorflow-1.3.0 tensorflow-tensorboard-0.1.6 werkzeug-0.12.2
4. 初用tensorflow,hello tensorflow!
[wai@waideMacBook ~/tensorflow/bin]$source activate
(tensorflow) [wai@waideMacBook ~/tensorflow/bin]$python
Python 2.7.10 (default, Feb 7 2017, 00:08:15)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>>
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
2017-09-07 22:42:56.980323: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-09-07 22:42:56.980373: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-09-07 22:42:56.980392: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2017-09-07 22:42:56.980410: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
>>> print(sess.run(hello))
Hello, TensorFlow!
>>> import os
>>> os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
>>> sess = tf.Session()
>>> print(sess.run(hello))
Hello, TensorFlow!
- 初入Tensorflow一览(1)
- 初入tensorflow一览(2)
- tensorflow 学习(1) minist数据初入
- TensorFlow初入
- TensorFlow Docker一览
- tensorflow函数一览
- TensorFlow从1到2 | 第五章 非专家莫入!TensorFlow实现CNN
- 安装Tensorflow(入坑指南)
- 初入手势识别(1)
- 初入
- 初入
- 初入
- 初入
- 初入
- 计算机英语单词一览1
- WCF初入(1) 开篇之一
- WCF初入(1) 开篇之二
- 初入css,网上资料转载 1
- Python-IDLE实现清屏
- [Leetcode]Dynamic Programming-note
- shell if语句和test命令
- 阿里云|REDIS 开启多个端口
- JavaScript实现图片轮播图
- 初入Tensorflow一览(1)
- 9.10NOIP模拟赛
- linux中磁盘的挂载
- 贪婪算法之找零钱
- element ui 的树形组件上手
- Java中的static使用之静态变量、静态方法和静态初始化块
- YTU.2748: 双向冒泡排序
- 输出第N个丑数
- An Improved Differential Evolution Algorithm for Unconstrained Optimization Problems