当前位置:网站首页>TensorFlow Lite源码解析
TensorFlow Lite源码解析
2022-07-26 16:25:00 【秋水 墨色】
TensorFlow Lite是专门针对移动和嵌入式设备的特性重新实现的TensorFlow版本。相比普通的TensorFlow,它的功能更加精简,不支持模型的训练,不支持分布式运行,也没有太多跨平台逻辑,支持的op也比较有限。TensorFlow Lite使用运行于移动端,有些设备甚至是资源非常有限,因此在内存和解析方面必须尽可能减少开销。TensorFlow导出的模型使用的是Protocol Buffer协议,因此有必要将它转换到性能更优的FlatBuffer格式。
可以通过多个Delegate使用多个加速器做加速的,只要我们在Interpreter实例化之后以及调用Interpreter.Invoke()之前依次初始化不同类型的Delegate,例如GPU、NNAPI等的Delegate,并且使用interpreter->ModifyGraphWithDelegate(delegate)对这些Delegate一一注册便可以。
TFLite进行推理主要分为以下几步:
1. 加载模型文件。
2. 创建一个类Interpreter的实例。在这个过程中,推理引擎会对模型进行解析、分配模型运行过程中需要的内存空间以及确定模型中各个层之间的执行顺序。
3. 通过Delegate使用加速器做加速。
4. 准备输入数据,这个需要根据模型要求的输入格式做对应的处理;
5. 调用Interpreter.Invoke()进行推理;
6. 获取推理结果。
预训练模型:
- inception v3:用于目标检测
- MobileNets:专门针对移动端的模型,具有低延迟,高速度,
边栏推荐
- C#转整型的三种方式的区别以及效率对比
- [e-mr] error recovery record of namenode
- Differences between the use of structs and classes
- From SiCp to LISP video replay
- movable-view 组件(可上下左右拖动 )
- Want the clouds in the picture to float? Video editing services can be achieved in three steps with one click
- vlang捣鼓之路
- ES:Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes
- Bugku login2
- 怎么使用C语言嵌套链表实现学生成绩管理系统
猜你喜欢

Difference between C event and delegation

The difference between anonymous methods and lambda expressions

guetzli简单使用

TDengine 落地协鑫能科,数百亿数据压缩至 600GB
![[arm learning (9) ARM compiler understanding learning (armcc/armclang)]](/img/6c/df2ebb3e39d1e47b8dd74cfdddbb06.gif)
[arm learning (9) ARM compiler understanding learning (armcc/armclang)]

Alibaba Cloud Toolkit —— 项目一键部署工具

Docker install redis? How to configure persistence policy?

【Flutter -- 进阶】打包
![[ten thousand words long text] Based on LSM tree thought Net 6.0 C # realize kV database (case version)](/img/84/640de0bf779cd45498204909be56d1.png)
[ten thousand words long text] Based on LSM tree thought Net 6.0 C # realize kV database (case version)

Understanding JS foundation and browser engine
随机推荐
srec_cat 常用参数的使用
Comprehensively design an oppe homepage -- layout and initialization
FTP protocol
Final consistency distributed transaction TCC
公共数据如何兼顾开放利用和隐私安全合规?
guetzli简单使用
[arm learning (9) ARM compiler understanding learning (armcc/armclang)]
NUC 11 build esxi 7.0.3f install network card driver-v2 (upgraded version in July 2022)
综合设计一个OPPE主页--明星机型的设计
PAT甲级 1044 Shopping in Mars
2022 test questions and answers for the latest national fire facility operator (senior fire facility operator)
Re8:读论文 Hier-SPCNet: A Legal Statute Hierarchy-based Heterogeneous Network for Computing Legal Case
Nacos win10 安装配置教程
Pat grade a 1044 shopping in Mars
The difference between oncreate and onrestoreinstancestate recovery data of activity
Nacos win10 installation and configuration tutorial
怎么使用C语言嵌套链表实现学生成绩管理系统
mysql锁机制(举例说明)
A firefox/chrome plug-in that visualizes browser history
Trends in software testing tools in 2021