美文网首页
centos7安装tensorflow

centos7安装tensorflow

作者: 吴建台 | 来源:发表于2017-12-08 12:12 被阅读0次

1.安装pip

yum -y install epel-release

yum install python-pip python-dev

pip install --upgrade pip

2.下载tensorflow-1.0.0-cp27-none-linux_x86_64.whl

之后pip安装:pip install tensorflow-1.0.0-cp27-none-linux_x86_64.whl

3.测试,建立test.py(os.environ['TF_CPP_MIN_LOG_LEVEL']='2',屏蔽了一些警告,主要是用来加速处理,除非用源码安装才不会有这些警告)

import os

os.environ['TF_CPP_MIN_LOG_LEVEL']='2'

import tensorflow as tf

hello = tf.constant('Hello,TensorFlow!')

sess = tf.Session()

print sess.run(hello)

a = tf.constant(10)

b = tf.constant(32)

print sess.run(a+b)

4.python test.py

相关文章

网友评论

      本文标题:centos7安装tensorflow

      本文链接:https://www.haomeiwen.com/subject/qiceixtx.html