tensorflow学习笔记

tensorflow学习笔记

  • 1. 安装
  • 2. 验证GPU是否可用
  • 3. 静态图说明

tensorflow学习过程中记录的笔记

1. 安装

cuda的安装过程略,参考pytorch的那篇笔记。

一个稳定版本的tensorflow2.5版本匹配:

conda create -n hi_hand_det python=3.7.0
conda install cudatoolkit=11.3.1
conda install cudnn=8.2.1
pip install tensorflow-gpu==2.5.0

2. 验证GPU是否可用

import tensorflow as tf
print(tf.test.is_gpu_available())

如果返回为True,说明GPU已经可用。

3. 静态图说明

参考:tensorflow静态图原理

笔记:在模型训练初始化init阶段的最后,需要用任意数值的指定矩阵形状让模型先运行一次,从而生成静态图,这样后续就会直接运行静态图。

你可能感兴趣的:(python/AI学习笔记,tensorflow,学习,笔记,python,人工智能)