当前位置:网站首页>TNN notes
TNN notes
2022-07-21 11:18:00 【Early lunar month in Pingqiu】
(TNN frame )
Model deployment :
1. Model transformation :
Will be in tensorflow, pytorch, caffe Wait for the model trained by the platform , First turn to unified onnx Format , Re convert to TNN Format model .
tnn The environment that model transformation needs to rely on is relatively complex , It is suggested to directly use the official built docker.
docker pull turandotkay/tnn-convert:latest
To validate the docker Whether the image can be used normally :
docker run -it tnn-convert:latest python3 ./converter.py -h
At present, we support onnx2tnn, caffe2tnn, tf2tnn, tflite2tnn
usage: python3 ./converter.py onnx2tnn -tp ONNX_PATH -in input_name -on output_name [-o OUTPUT_DIR] [-v v1.0] [-optimize] [-half] [-align]
v: Specify the version number of the model , In order to track and distinguish the model later .
output_dir: This parameter is generally not used , Pair will be generated by default TNN The model is placed in the same path as the current model to be converted .
optimize: Optimize the model , Strongly enable this option , Only when turning on this option fails to convert the model , It is recommended to remove this option and try again .
half: The model data passes through FP16 For storage , Reduce the size of the model . Default by FP32 Storage model .
align: Will be converted to TNN Align the model with the original model , determine TNN Whether the model is successfully converted . Currently, only single input single output model and single input multiple output model are supported .align Only support FP32 Model verification .
So use align You can't use half.
input_file: Specify the input file name required for model alignment .
ref_file: Specify the name of the output file to be aligned .
example: docker run --volume=${pwd}:/workspace -it tnn-convert:latest python3 ./converter.py onnx2tnn \
/workspace/mobilenetv3-small-c7eb32fe.onnx \
-optimize \
-v v3.0 \
-align
2. Build engine :
Hardware support for the target platform , Complete the target platform TNN Engine compilation .
Mobile demo:
1. iOS demo
2. Android demo
边栏推荐
- Analysis of WPF multi finger application development
- 19_ Built in instructions
- Self study notes on Bayesian probability and Bayesian networks and Bayesian causal networks
- Network Security Learning (VI) DNS deployment and security
- How to effectively avoid code being "poisoned"?
- 高通连发三款处理器:骁龙730G有望成为次旗舰首选!
- VC all rested? In the first half of the year, Hillhouse venture capital made nearly 80 shots, 60% before the a-round
- 关于常量修饰符 const
- Tmech publishes the latest progress in the operation control technology of the must choose: to realize the high robustness walking of humanoid robots
- 網絡安全學習(七)IIS
猜你喜欢
Network Security Learning (VI) DNS deployment and security
Pass teacher liaoxuefeng's series of courses quickly 1
Debezium grabs data from Oracle to Kafka
廖雪峰老师系列课程 迅速过一遍 1
张小泉,冤吗?
马斯克:我把大脑上传云端啦,不好意思,404了
李宏毅老师2020年深度学习系列讲座笔记4
李宏毅老师2020年深度学习系列讲座笔记5
Zhang Xiaoquan, are you wronged?
论文笔记:Accurate Causal Inference on Discrete Data
随机推荐
网络安全学习(九)综合实验&PKI
“海信的 B 面”科技展开幕!海信 B2B 代表产品首次集体亮相!
class, classloder, dex 详解
WPF 使用PathGeometry画时针和分针
李宏毅老师2020年深度学习系列讲座笔记3
VC 都歇了?上半年高瓴创投出手近 80 次,六成 A 轮前
【2022华为开发者大赛系列直播】华为开发者大赛—乾坤云服务赛事解读
Squeeze-and-Excitation Networks
进程/线程同步机制
李宏毅老师2020年深度学习系列讲座笔记4
influxdb查询时间戳问题
Debian 9 下编译安装PHP及配置
%s. Placeholders for%1$s,%d,%1$d
IBM MQ operation and maintenance manual
19_内置指令
Network Security Learning (VIII) domain
Wpf 多指应用开发解析
Tmech publishes the latest progress in the operation control technology of the must choose: to realize the high robustness walking of humanoid robots
网络安全学习(七)IIS
深度学习基础与实践课程笔记0&1