安装TensorFlow

1. 安装TensorFlow1.0.1

# Ubuntu/Linux 64-bit, CPU only, Python 2.7
(tf101py27) tsiangleo@hadoop:~$ pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.1-cp27-none-linux_x86_64.whl

上面的命令可能会报错参考Blog: SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)
可先将whl包下载下来,然后进行安装,如下所示:

(tf101py27) tsiangleo@hadoop:~$ wget https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.1-cp27-none-linux_x86_64.whl
(tf101py27) tsiangleo@hadoop:~$ pip install --upgrade tensorflow-1.0.1-cp27-none-linux_x86_64.whl

这个过程要持续一段时间,系统会下载相关的依赖包,比如numpy等。
安装成功后输出:Successfully installed numpy-1.12.1 pbr-3.0.0 protobuf-3.2.0 tensorflow-1.0.1

2. 验证TensorFlow是否安装成功

(tf101py27) tsiangleo@hadoop:~/tf101py27$ python
Python 2.7.8 (default, Jun 18 2015, 18:54:19) [GCC 4.9.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import tensorflow as tf >>> tf.__version__ '1.0.1' >>>

猜你喜欢

转载自blog.csdn.net/qq_29068265/article/details/80614933