機器學習-TensorFlow安裝
環境準備
centos 7
python 2.7
[root@master ~]# uname -a
Linux master 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
[root@master ~]# python -V
Python 2.7.5
安裝pip
[root@master ~]# yum update -y && yum install -y python python-devel epel-release.noarch python-pip
如果出現了安裝pip失敗了就用
yum install python-pip安裝
pip安裝成功會顯示
[root@master ~]# pip
Usage:
pip <command> [options]
Commands:
install Install packages.
download Download packages.
uninstall Uninstall packages.
freeze Output installed packages in requirements format.
list List installed packages.
show Show information about installed packages.
search Search PyPI for packages.
wheel Build wheels from your requirements.
hash Compute hashes of package archives.
completion A helper command used for command completion
help Show help for commands.
使用pip安裝tensorflow
# 僅使用 CPU 的版本
$ pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
# 開啟 GPU 支援的版本 (安裝該版本的前提是已經安裝了 CUDA sdk)
$ pip install https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
安裝完成以後測試TensorFlow是否成功
[root@master ~]# python
Python 2.7.5 (default, Nov 6 2016, 00:28:07)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
I tensorflow/core/common_runtime/local_device.cc:25] Local device intra op parallelism threads: 8
I tensorflow/core/common_runtime/local_session.cc:45] Local session inter op parallelism threads: 8
>>> print sess.run(hello)
Hello, TensorFlow!
>>> a = tf.constant(10)
>>> b = tf.constant(32)
>>> print sess.run(a+b)
42
相關文章
- TensorFlow安裝
- 安裝TensorFlow
- tensorflow:使用conda安裝tensorflow
- 安裝了IDLE後安裝tensorflow
- Windows原生安裝TensorFlowWindows
- TensorFlow 安裝詳解
- tensorflow安裝問題
- tensorflow-gpu 安裝GPU
- WIN10 安裝tensorflowWin10
- docker安裝tensorflow-gpuDockerGPU
- 基於docker安裝tensorflowDocker
- Tensorflow介紹和安裝
- tensorflow 之 bazel安裝 & 使用
- Tensorflow GPU版本安裝教程GPU
- 請教 TensorFlow 安裝問題
- Linux Tensorflow2.0安裝Linux
- docker環境下安裝tensorflowDocker
- 安裝tensorflow超快的方法
- python3.7 安裝tensorflowPython
- Windows安裝tensorflow教程 GPU版WindowsGPU
- TensorFlow 起飛之旅 · 安裝 · demo
- Windows 10 64位 安裝TensorFlowWindows
- window傻瓜式安裝tensorflow
- 在CentOS 7上安裝TensorflowCentOS
- centos7下安裝tensorflowCentOS
- windows下安裝pip,強制升級pip,安裝tensorflowWindows
- TensorFlow-GPU安裝避坑指南GPU
- ubuntu16+tensorflow-gpu安裝cudaUbuntuGPU
- gtx750安裝tensorflow-gpuGPU
- Ubuntu 16.04 安裝 Tensorflow Gpu版本UbuntuGPU
- 安裝Tensorflow使用AVX指令集
- 在Ubuntu 18.04上安裝TensorflowUbuntu
- 終端裝置上的機器學習: Android裝置上的TensorFlow [session]機器學習AndroidSession
- 【TensorFLow】Ubuntu16.04安裝CUDA8.0+cuDNN6.0+TensorFlowUbuntuDNN
- Jupyter notebook 中用 pip 安裝 tensorflow
- 【浪子男孩】TensorFlow-GPU版本安裝教程GPU
- tensorflow 2.x CPU/GPU安裝攻略GPU
- Mac安裝TensorFlow的異常處理Mac