CentOS 6.6 x64安裝TensorFlow

CentOS 6.6 x64安裝TensorFlow
升級Python到2.7(系統自帶Python版本爲2.6)
// 安裝編譯工具
$ yum -y install gcc automake autoconf libtool makepython

// 安裝依賴庫
$ yum install -y zlib-devel openssl-devel bzip2-devellinux

// 下載編譯Python
$ wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgz
$ tar zxvf Python-2.7.13.tgz
$ cd Python-2.7.13
$ ./configure
$ make && make installc++

// 更新系統默認Pythonapi

$ mv /usr/bin/python /usr/bin/python2.6.6
$ ln -s /usr/local/bin/python2.7 /usr/bin/pythonpython2.7

// 修改yum所使用Python版本爲2.6
$ vi /usr/bin/yum
#!/usr/bin/python 修改成 #!/usr/bin/python2.6.6工具

// 安裝setup-tools
$ wget https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg --no-check-certificate
$ chmod +x setuptools-0.6c11-py2.7.egg
$ sh setuptools-0.6c11-py2.7.egg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
2.安裝pip工具測試

$ wget https://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz --no-check-certificat
$ tar zxvf pip-1.3.1.tar.gz
$ cd pip-1.3.1
$ python setup.py install
$ ln -s /usr/local/python2.7/bin/pip /usr/bin/pip
1
2
3
4
5
3.安裝TensorFlowui

$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0rc0-cp27-none-linux_x86_64.whl
1
可能出現的問題: 報錯」Can’t find setup.py」
解決方案:使用pip install –upgrade pip命令升級pipgoogle

4.升級GLIBC到2.17.net

$ wget http://ftp.gnu.org/gnu/libc/glibc-2.17.tar.gz
$ tar -zxvf glibc-2.17.tar.gz
$ cd glibc-2.17
$ mkdir build
$ cd build
$ ../configure --prefix=/usr --with-headers=/usr/include --with-binutils=/usr/bin
$ make && make install
1
2
3
4
5
6
7
5.升級GCC到4.8.3

$ wget http://ftp.gnu.org/gnu/gcc/gcc-4.8.3/gcc-4.8.3.tar.gz
$ tar -zxvf gcc-4.8.3.tar.gz
$ cd gcc-4.8.3
$ ./contrib/download_prerequisites 
$ mkdir build
$ cd build
$ yum -y install gcc-c++
$ ../configure -enable-checking=release -enable-languages=c,c++ -disable-multilib
$ make && make install
$ cp ./stage1-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.19 /usr/lib64
$ cd /usr/lib64
$ rm -f /usr/lib64/libstdc++.so.6
$ ln -s libstdc++.so.6.0.19 libstdc++.so.6
1
2
3
4
5
6
7
8
9
10
11
12
13
6.測試TensorFlow

$ python >> import tensorflow as tf >> hello = tf.constant('Hello World!') >> with tf.Session() as sess: >> output = sess.run(hello) >> print output123456測試結果輸出:Hello,World!--------------------- 做者:numen27 來源:CSDN 原文:https://blog.csdn.net/numen27/article/details/75332833 版權聲明:本文爲博主原創文章,轉載請附上博文連接!

相關文章
相關標籤/搜索