windows环境下tensorflow手把手安装教程-pip安装

这次得容易多了

  • 1.安装python
  • 2.pip 安装
  • 3.一些基础知识

前面和conda安装是一模一样得,区别在后面。

1.安装python

https://www.python.org/
windows环境下tensorflow手把手安装教程-pip安装_第1张图片

All Releases 会看到全部python可下载版本

windows环境下tensorflow手把手安装教程-pip安装_第2张图片

从python官网下载python安装包
本人使用py版本python 3.9.7————不要装最新的,不稳定!!!
记得添加系统路径变量

2.pip 安装

https://tensorflow.google.cn/install
windows环境下tensorflow手把手安装教程-pip安装_第3张图片

# 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

硬件要求值得安装者注意
windows环境下tensorflow手把手安装教程-pip安装_第4张图片

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

你可能感兴趣的:(人工智能,算法,Python相关,tensorflow,python,深度学习)