1.centos7是预装python的,首先查看python版本
# python -v
可以看到python版本是2.7.5,TensorFlow Python API 依赖 Python 2.7 版本。所以下载和安装很方便(运用pip),这里下载时注意安全组问题。
2.安装pip
# yum update -y && yum install -y python python-devel epel-release.noarch python-pip
安装成功后画面如下
3.安装Tensorflow
# pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
出现Successfuly… 就安装成功了~
4.简单测试
# python
>>> import tensorflow as tf
>>> helloWorld = tf.constant('hello world!')
>>> session = tf.session()
>>> print session.run(helloWorld)
hello world!