linux下安装TensorFlow(centos)
生活随笔
收集整理的這篇文章主要介紹了
linux下安装TensorFlow(centos)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
一、python安裝
centos自帶python2.7.5,這一步可以省略掉。
二、python-pip
pip--python index package,累世linux的yum,安裝管理python軟件包用的。
yum install python-pip python-devel?
三、安裝tensorflow
安裝基于linux和python2.7的tensorflow 0.9
pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl其他操作系統版本可以參照下表:
# Ubuntu/Linux 64-bit, CPU only, Python 2.7export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl # Ubuntu/Linux 64-bit, GPU enabled, Python 2.7 # Requires CUDA toolkit 7.5 and CuDNN v4. For other versions, see "Install from sources" below.export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl # Mac OS X, CPU only, Python 2.7:export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/tensorflow-0.9.0-py2-none-any.whl # Ubuntu/Linux 64-bit, CPU only, Python 3.4export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp34-cp34m-linux_x86_64.whl # Ubuntu/Linux 64-bit, GPU enabled, Python 3.4 # Requires CUDA toolkit 7.5 and CuDNN v4. For other versions, see "Install from sources" below.export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp34-cp34m-linux_x86_64.whl # Ubuntu/Linux 64-bit, CPU only, Python 3.5export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp35-cp35m-linux_x86_64.whl # Ubuntu/Linux 64-bit, GPU enabled, Python 3.5 # Requires CUDA toolkit 7.5 and CuDNN v4. For other versions, see "Install from sources" below.export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp35-cp35m-linux_x86_64.whl # Mac OS X, CPU only, Python 3.4 or 3.5:export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/tensorflow-0.9.0-py3-none-any.whl
四、測試安裝是否成功
編寫python腳本 test.py
import tensorflow as tf hello = tf.constant('Hello,TensorFlow!') sess = tf.Session() print(sess.run(hello)) a = tf.constant(10) b = tf.constant(32) print(sess.run(a + b))運行 python test.py結果如下:
大功告成。
總結
以上是生活随笔為你收集整理的linux下安装TensorFlow(centos)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 怎样在黑窗口中查找各种端口
- 下一篇: 第一篇 webApp启航