关于tensorflow:TensorFlow之安装篇

1.windws下linux环境搭建
在windows10上装置linux子系统的步骤,详见https://www.linuxprobe.com/wi…。
我抉择的Ubuntu子系统如下

环境阐明:
Ubuntu 20.04.1 LTS
python 3.8(Ubuntu环境自带的)

2.装置pip

$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py   # 下载安装脚本
$ sudo python3 get-pip.py    # 运行装置脚本 留神这里我的环境变量是python3

环境阐明:
pip 21.0

3.装置tensorflow

#形式1
sudo pip3 install tensorflow

#形式2 先下载,后装置
#2.1 依据环境从https://pypi.org/project/tensorflow/2.4.1/#files下载相应文件
#2.2 装置
sudo pip3 install tensorflow-2.4.1-cp38-cp38-manylinux2010_x86_64.whl

4.验证tensorflow

import tensorflow as tf

tf.compat.v1.disable_eager_execution()
sess = tf.compat.v1.Session()
a = tf.constant(10)
b = tf.constant(12)
sess.run(a+b)

5.参考文献
[1] https://www.linuxprobe.com/wi…
[2] https://www.cnblogs.com/phppe…
[3] https://blog.csdn.net/sinat_3…
[4] https://www.cnblogs.com/zlc36…

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理