TensorFlow之安裝篇

1.windws下linux環境搭建
在windows10上安裝linux子系統的步驟,詳見https://www.linuxprobe.com/wi...
我選擇的Ubuntu子系統以下
image.pngphp

環境說明:
Ubuntu 20.04.1 LTS
python 3.8(Ubuntu環境自帶的)html

2.安裝pippython

$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py   # 下載安裝腳本
$ sudo python3 get-pip.py    # 運行安裝腳本 注意這裏個人環境變量是python3

環境說明:
pip 21.0linux

3.安裝tensorflowbootstrap

#方式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.驗證tensorflowsegmentfault

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...windows

相關文章
相關標籤/搜索