Skip to content

tensorflow 入门

Posted on:March 23, 2023 at 11:03 PM

背景

最近chatgpt 很流行 ,所以想了解一下TensorFlow是怎么拟合数据的

python 版本

$python3 -V
Python 3.10.6

安装

安装分为pip 方式和jupyter方式

我用的是pip安装的方式

curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -o Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
## 我的python是3.10 , 根据自己情况改
conda create --name tf python=3.10
(tf) dai@myhost:~$ pip install tensorflow==2.11.*
(tf) dai@myhost:~$ python3 -c "import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000, 1000])))"

相关阅读