安装tensorflow1.0

来源:互联网 发布:济南浪潮数据 编辑:程序博客网 时间:2024/05/22 13:21

1、安装相关依赖包

yum install python-devel libffi-devel openssl-devel

2 、下载pip

wget https://bootstrap.pypa.io/get-pip.py

3 、安装pip

python get-pip.py

4、安装tensorflow1.0版本

pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.0-cp27-none-linux_x86_64.whl

5、实验

>>import tensorflow as tf
>> tf.InteractiveSession()
>>a=tf.zeros((2,2));b=tf.ones((2,2))
>>tf.reduce_sum(b,reduction_indices=1).eval()
>>a.get_shape()
>>tf.reshape(a,(1,4)).eval()
>>na=np.zeros((2,2))
>>print na
0 0