ubuntu20.04 python3.8.10 tensorflow2.7.0
环境: ubuntu20.04
Python3.8.10
whl安装,特点:快
百度链接:链接:https://pan.baidu.com/s/13orpjF-DleAIxwrR0ZZsEg
提取码:f4m5
--来自百度网盘超级会员V1的分享
复制粘贴下载的whl,在对应文件位置打开终端,输入代码:
sudo pip3 install tensorflow-2.7.0-cp38-cp38-linux_x86_64.whl
多安装几次,然后重启
安装后,查看版本:
python3
import tensorflow as tf
tf.__version__
查询tensorflow安装路径为:
tf.__path__
测试程序:
import tensorflow as tf
tf.compat.v1.disable_eager_execution()#使用第一版本
a = tf.constant(11.0)
b = tf.constant(20.0)
c = tf.add(a,b)
sess = tf.compat.v1.Session()#2.0版本没有session
c_res=sess.run(c)
print(c_res)

浙公网安备 33010602011771号