这次得容易多了
前面和conda安装是一模一样得,区别在后面。
1.安装python
https://www.python.org/
All Releases 会看到全部python可下载版本
从python官网下载python安装包
本人使用py版本python 3.9.7————不要装最新的,不稳定!!!
记得添加系统路径变量
2.pip 安装
https://tensorflow.google.cn/install
# Requires the latest pip
pip install --upgrade pip
# Current stable release for CPU and GPU
pip install tensorflow
# Or try the preview build (unstable)
pip install tf-nightly
硬件要求值得安装者注意
3.一些基础知识
设置和基本用法
import os
import tensorflow as tf
import cProfile
在 Tensorflow 2.0 中,默认启用 Eager Execution。
tf.executing_eagerly()
返回结果
True
张量运算
x = [[2.]]
m = tf.matmul(x, x)
print("hello, {}".format(m))
a = tf.constant([[1, 2],
[3, 4]])
print(a)
tf.Tensor(
[[1 2]
[3 4]], shape=(2, 2), dtype=int32)
其余内容大家自行去看官方文档吧。
https://tensorflow.google.cn/guide/eager