ubuntu14安装tensorflow

前端之家收集整理的这篇文章主要介绍了ubuntu14安装tensorflow前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

ubuntu14安装tensorflow

  1. python --version
  1. wget https://bootstrap.pypa.io/get-pip.py --no-check-certificate
  1. sudo python get-pip.py
  1. pip --version
  1. pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl


1、python2.7版本

  1. root@baolibin:/# python --version
  2. Python 2.7.6
  3. root@baolibin:/#

2、安装pip
  1. root@baolibin:/# wget https://bootstrap.pypa.io/get-pip.py --no-check-certificate
  2. --2016-10-18 23:09:54-- https://bootstrap.pypa.io/get-pip.py
  3. 正在解析主机 bootstrap.pypa.io (bootstrap.pypa.io)... 151.101.36.175
  4. 正在连接 bootstrap.pypa.io (bootstrap.pypa.io)|151.101.36.175|:443... 已连接。
  5. 已发出 HTTP 请求,正在等待回应... 200 OK
  6. 长度: 1524722 (1.5M) [text/x-python]
  7. 正在保存至: get-pip.py
  8.  
  9.  
  10. 100%[===============================================================================================>] 1,524,722 5.73KB/s 用时 11m 0s
  11.  
  12.  
  13. 2016-10-18 23:20:58 (2.25 KB/s) - 已保存 get-pip.py [1524722/1524722])
  14.  
  15.  
  16. root@baolibin:/#

  1. root@baolibin:/# sudo python get-pip.py
  2. Collecting pip
  3. /tmp/tmpbahmxa/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made,but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate,which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information,see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
  4. /tmp/tmpbahmxa/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information,see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  5. Downloading pip-8.1.2-py2.py3-none-any.whl (1.2MB)
  6. 100% |████████████████████████████████| 1.2MB 14kB/s
  7. Collecting setuptools
  8. Downloading setuptools-28.6.0-py2.py3-none-any.whl (471kB)
  9. 100% |████████████████████████████████| 481kB 13kB/s
  10. Collecting wheel
  11. Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
  12. 100% |████████████████████████████████| 71kB 20kB/s
  13. Installing collected packages: pip,setuptools,wheel
  14. Successfully installed pip-8.1.2 setuptools-28.6.0 wheel-0.29.0
  15. /tmp/tmpbahmxa/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information,see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  16. root@baolibin:/#

3、pip版本
  1. root@baolibin:/# pip --version
  2. pip 8.1.2 from /usr/local/lib/python2.7/dist-packages (python 2.7)
  3. root@baolibin:/#

4、安装tensoflow
  1. root@baolibin:/# pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
  2. Collecting tensorflow==0.5.0 from https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
  3. /usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made,see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
  4. SNIMissingWarning
  5. /usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information,see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  6. InsecurePlatformWarning
  7. Downloading https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl (10.9MB)
  8. 100% |████████████████████████████████| 10.9MB 81kB/s
  9. Collecting numpy>=1.9.2 (from tensorflow==0.5.0)
  10. /usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information,see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  11. InsecurePlatformWarning
  12. Downloading numpy-1.11.2-cp27-cp27mu-manylinux1_x86_64.whl (15.3MB)
  13. 100% |████████████████████████████████| 15.3MB 47kB/s
  14. Collecting six>=1.10.0 (from tensorflow==0.5.0)
  15. Downloading six-1.10.0-py2.py3-none-any.whl
  16. Installing collected packages: numpy,six,tensorflow
  17. Found existing installation: six 1.5.2
  18. DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
  19. Uninstalling six-1.5.2:
  20. Successfully uninstalled six-1.5.2
  21. Successfully installed numpy-1.11.2 six-1.10.0 tensorflow-0.5.0
  22. root@baolibin:/#

5、运行tensorflow
  1. root@baolibin:/# python
  2. Python 2.7.6 (default,Jun 22 2015,17:58:13)
  3. [GCC 4.8.2] on linux2
  4. Type "help","copyright","credits" or "license" for more information.
  5. >>> import tensorflow as tf
  6. >>> hello = tf.constant('hello tensorflow')
  7. >>> sess=tf.Session()
  8. I tensorflow/core/common_runtime/local_device.cc:25] Local device intra op parallelism threads: 4
  9. I tensorflow/core/common_runtime/local_session.cc:45] Local session inter op parallelism threads: 4
  10. >>> print sess.run(hello)
  11. hello tensorflow
  12. >>> a=tf.constant(10)
  13. >>> b=tf.constant(23)
  14. >>> print sess.run(a+b)
  15. 33
  16. >>> quit()

猜你在找的Ubuntu相关文章