Centos7安装Tensorflow

来源:互联网 发布:ubuntu 16.04 pyqt5 编辑:程序博客网 时间:2024/06/05 11:11

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!