2 使用Python训练和部署低精度模型 张校捷使用Python训练和部署低精度模型 (TensorFlow版) 张校捷 2019/9/21 目录 CONTENTS 低精度的概念和意义 TensorFlow的FP16模型 TensorRT的FP16/Int8模型 总结 1 低精度的概念和意义 实数的16-bit半精度浮点数和8-bit定点数表示 使用低精度的意义 深度学习模型中实数的表示 FP32: E8M23 FP16: 5 3.3X speedup SSD-RN50-FPN-640 2.5X speedup FP16浮点数(E5M10)的表示范围 FP16模型的训练方法 Int8模型的推断过程 2 TensorFlow的FP16模型 实数的16-bit半精度浮点数和8-bit定点数表示 使用低精度的意义 TensorCores适用条件 1. 卷积:K(输入通道),C(输出通道) 2. 通用矩阵乘法 TF_ENABLE_CUDNN_TENSOR_OP_MATH_FP32=1 TF_ENABLE_CUDNN_RNN_TENSOR_OP_MATH_FP32=1 TensorFlow手动转换模型 import tensorflow as tf import numpy as numpy input = tf.placeholder(dtype=tf.float32, shape=[None,0 码力 | 24 页 | 981.45 KB | 1 年前3
5 Python深度学习实践深度学习实践 from Tensorflow to AI-Hub 王顺 – Google Cloud 目录 CONTENTS 从零开始 初步修改 业务升级 实践指南 1 从hello world开始 以深度学习的第一个案例MNIST为例 学习Tensorflow框架的使用及代码编写风格 理解TF Mac CPU运行结果 GPU运行结果 TPU运行结果 TPU的创建和使用 TPU的创建和使用 TPU训练MNIST的改动 TPU训练MNIST的改动 https://www.tensorflow.org/guide/distribute_strateg y resolver = tf.distribute.cluster_resolver.TPUClusterResolver() tf.tpu.experimental.initialize_tpu_system(resolver) predictions bad in the morning hours? 16 Chicago Taxi Cab Dataset Tensorflow/Keras中的网络 Custom training with TPUs • https://www.tensorflow.org/tutorials/distribute/tpu_custom_training 3 业务升级 以上已经针对MNIST做了一些深入学习0 码力 | 38 页 | 4.85 MB | 1 年前3
PyConChina2022-杭州-ARM芯片的Python+AI算力优化-朱宏林本次演讲,将向大家介绍我们在倚天 710 ARM 芯片上开展的 Python + AI 优化工作,以及在 ARM 云平台上部署 Python + AI 任务的最佳实践。 深度学习 • 广泛使用的深度学习框架 • TensorFlow、PyTorch • 结合硬件(ARM 服务端芯片) • 倚天 710 • AWS graviton • 矩阵乘法 • 为什么矩阵乘法是深度学习的核心 • Conv、Linear、Transformers (2x4) * (4x2) • 16 mul + 16 add 深度学习推理加速 • BF16 gemm 实现 • ARM Compute Library • OpenBLAS • TensorFlow • oneDNN + ACL • DNNL_DEFAULT_FPMATH_MODE=BF16 • PyTorch • OpenBLAS • oneDNN + ACL • torch set_float32_fast_math_mode("BF16") 深度学习推理加速 • BF16 gemm 实现 • ARM Compute Library • OpenBLAS • TensorFlow • oneDNN + ACL • DNNL_DEFAULT_FPMATH_MODE=BF16 • PyTorch • OpenBLAS • oneDNN + ACL • torch0 码力 | 24 页 | 4.00 MB | 1 年前3
Notes for install Keras on Anaconda3install Keras and Tensorflow for RStudio which works for most machines. However, if you have a PC which has a CPU purchased before 2012, the current versions(1.10-2.1) of Tensorflow could not be loaded loaded as AVX instructions set is needed from Tensorflow 1.6 and later. Please ensure your machine was purchased in 2012 or later. Step 1 Follow the document or video to install Anaconda3 and RStudio: this prompt: 1 conda install python=3.6 2 conda install -c conda-forge tensorflow 3 conda install -c r r-tensorflow 4 conda install -c conda-forge r-keras C) Open the RStudio and run the0 码力 | 3 页 | 654.13 KB | 8 月前3
2 张孝峰 Python与云 AWS的Python原生应用浅析 自己动手安装 AWS - 运行TensorFlow的首选平台 云中TensorFlow 工作负载 85% 运行在AWS上 Source: Nucleus Research, November 2018 自由切换环境 - TensorFlow 切换到Python3上的TensorFlow和Keras 2 启动 iPython 终端 运行 TensorFlow 程序 已切换环境 自由切换环境0 码力 | 42 页 | 8.12 MB | 1 年前3
8 4 Deep Learning with Python 费良宏 (University of Montreal, ~2010), 学院派 Kersa, “Deep Learning library for Theano and TensorFlow” Caffe (Berkeley),卷积神经网络,贾扬清 TensorFlow (Google) Spark MLLib 深度学习中的开发框架框架 THEANO 学院派血统,Montreal University 非常灵活,非常复杂 实践 THEANO 中的卷积极神经网络 为什么是 PYTHON ? 最好的"胶水"代码用于研究、快速开发 iPython, 数据可视化 丰富的框架资源Theano, Kersa, TensorFlow 海量的社区、开源的支持 为什么需要 GPU? 为什么需要 GPU? CPU - 指令并行执行,数据并行运算 GPU - 矩阵类型的数值计算,尤其浮点运算 建立自己的深度学习的应用环境 深度学习的应用环境- THEANO 深度学习的应用环境- THEANO 我的第一个Theano 程序 深度学习的应用环境- THEANO GPU vs. CPU TENSORFLOW 的新进展 分布式的深度学习框架 TENSORFLOW 的新进展 分布式的深度学习框架 工程化思维 VS. 科学化思维 THINK GREAT THOUGHTS AND YOU WILL BE GREAT.0 码力 | 49 页 | 9.06 MB | 1 年前3
Python的智能问答之路 张晓庆 计算fasttext label • numpy:计算w2v cosine/fasttext cosine • wmd:计算wmd特征 • esim:计算lstm-esim特征 • tensorflow:计算transformer-esim特征 • scikit learn:调用LR训练模型 各个击破-评估 • 评估数据 Ø 领域均衡:6个领域,每个领域50个知识点 Ø 评估数据对 http:短链接,简单,开发方便 Ø grpc:长链接,安全性 3 Python开发的利与弊 优势总结、缺点举例 机器学习库scikit learn 计算库numpy 文本挖掘库gensim 深度学习库tensorflow等 强大的第三方 工具库 支持其它语言 优势互补 开发便捷 调试简单 语法简单 易用性强 无需复杂数据结构即可快速搭建 服务 无需编译 支持C++调用 支持Java调用0 码力 | 28 页 | 2.60 MB | 1 年前3
Conda 23.3.x Documentationtool. • Managing one-step installation of tools that are more challenging to install (such as TensorFlow or IRAF). • Allowing you to provide your environment to other people across different platforms conda. • Providing commonly used data science libraries and tools, such as R, NumPy, SciPy, and TensorFlow. These are built using optimized, hardware-specific libraries (such as Intel’s MKL or NVIDIA’s0 码力 | 370 页 | 2.94 MB | 8 月前3
Conda 23.5.x Documentationtool. • Managing one-step installation of tools that are more challenging to install (such as TensorFlow or IRAF). • Allowing you to provide your environment to other people across different platforms conda. • Providing commonly used data science libraries and tools, such as R, NumPy, SciPy, and TensorFlow. These are built using optimized, hardware-specific libraries (such as Intel’s MKL or NVIDIA’s0 码力 | 370 页 | 3.11 MB | 8 月前3
Conda 23.10.x Documentationtool. • Managing one-step installation of tools that are more challenging to install (such as TensorFlow or IRAF). • Allowing you to provide your environment to other people across different platforms conda. • Providing commonly used data science libraries and tools, such as R, NumPy, SciPy, and TensorFlow. These are built using optimized, hardware-specific libraries (such as Intel’s MKL or NVIDIA’s0 码力 | 773 页 | 5.05 MB | 8 月前3
共 21 条
- 1
- 2
- 3













