Linux下安装TensorFlow模块
准备:
centos7
python2.7
tensorflow-0.5.0-cp27-none-linux_x86_64.whl
安装:
使用pip命令需要安装python-pip软件包
(安装过程可参考https://www.runoob.com/w3cnote/python-pip-install-usage.html)
[root@localhost ~]# pip install tensorflow-0.5.0-cp27-none-linux_x86_64.whl
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Processing ./tensorflow-0.5.0-cp27-none-linux_x86_64.whl
Collecting six>=1.10.0 (from tensorflow==0.5.0)
Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting numpy>=1.9.2 (from tensorflow==0.5.0)
Downloading https://files.pythonhosted.org/packages/1f/c7/198496417c9c2f6226616cff7dedf2115a4f4d0276613bab842ec8ac1e23/numpy-1.16.4-cp27-cp27mu-manylinux1_x86_64.whl (17.0MB)
|████████████████████████████████| 17.0MB 182kB/s
Installing collected packages: six, numpy, tensorflow
Successfully installed numpy-1.16.4 six-1.12.0 tensorflow-0.5.0
调用TensorFlow模块:
[root@localhost ~]# python
Python 2.7.5 (default, Nov 20 2015, 02:00:19)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>>
这样就算成功了。
附:
tensorflow-0.5.0-cp27-none-linux_x86_64.whl下载地址:https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl(也可以去GitHub上下载)
网友评论