当前位置:网站首页>Ternsort model integration summary
Ternsort model integration summary
2022-07-04 11:20:00 【Ascetic monk runnercai】
Sometimes I'm dealing with deep learning When modeling , We need to use the model c++ Integrate . Here is an overview of , Lest I forget it next time :
The following are some comparisons of deep learning open source libraries I use PyTorch、TensorRT
PyTorch : yes Torch7 Team developed , You can see from its name that , And Torch The difference is that PyTorch Used Python As a development language . So-called “Python first”, It also shows that it is a Python Priority deep learning framework , Not only can you achieve powerful GPU Speed up , It also supports dynamic neural networks , This is now a mainstream framework, such as Tensorflow And so on .PyTorch It can be seen as joining GPU Supported by numpy, At the same time, it can also be regarded as a powerful deep neural network with automatic derivation function , except Facebook outside , It has also been Twitter、CMU and Salesforce And so on
Link to the original text :https://blog.csdn.net/broadview2006/article/details/80133047( Why use pytorch)
Pytorch Chinese learning website
https://www.pytorch123.com/
TensorRT: yes NVIDIA The high-performance deep learning reasoning optimizer , Usually used based on ResNet-50 and BERT Applications for . Use TensorRT and TensorFlow 2.0, Developers can achieve up to... In reasoning 7 Double acceleration .
Pytorch After the environment is configured , from github Download it. yolov5 Source code , And configure the corresponding environment on your computer and run , Generated weight file yolov5s.pt, Continue to compress it into onnx Model , Continue to use TensorRT Reasoning accelerates generation engine Model , Can be achieved through TensorRT Deploy yolov5 Model .
Generally speaking, deep learning is divided into two parts: training and deployment :
Training phase The first and most important thing is to build the network structure , Prepare the dataset , Use various frameworks to train , Training should include validation( verification ) and test( test ) The process of .
Deployment phase ,latency( Interaction delay ) Is a very important point , and TensorRT It's optimized for the deployment side , at present TensorRT Support most mainstream deep learning applications , Of course, the best is CNN( Convolutional neural networks ) field , But it's true TensorRT 3.0 There is a RNN Of API, That means we can do it inside RNN To infer (Inference)
Link to the original text :https://blog.csdn.net/Tosonw/article/details/92643231
TensorRT and PyTorch The story of the model
( Here mainly with yolo As a case study )
Yolov5 It's an algorithm , The default is to use pytorch Framework implementations :
https://github.com/ultralytics/yolov5
There are two ways to export models ,
The first is output wts The weight , And then convert it to engine Model , The final will be .engine Change it to .trt That's all right.
Reference resources :yolov5 The seventh step of deployment is completed tensorRT Model reasoning is accelerated
github Go to the warehouse :https://github.com/wang-xinyu/tensorrtx
The second is output onnx Intermediate model , And then convert it to .trt That's all right.
https://github.com/onnx/onnx-tensorrt
NVIDIA TensorRT It's a C ++ library , Can be done NVIDIA GPU High performance inference .
TensorRT Focus on GPU Reasoning on the network quickly and effectively , And generate a highly optimized runtime engine .
TensorRT adopt C ++ and Python Provide API, It can be done by API、 The parser loads the predefined model .
TensorRT Provides a runtime, Can be found in kepler All over a generation NVIDIA GPU On the implementation .
Link to the original text :https://blog.csdn.net/Tosonw/article/details/92643231
Foregoing :
TensorRT All in all 5 Stages : Creating networks 、 Constructive reasoning Engine、 Serialization engine 、 Deserialization engine and execution reasoning Engine
1) Creating networks 、 Constructive reasoning Engine、 Serialization engine
The three steps , We usually perform it alone after training the model , Store the serialized engine as a file after execution , When you reason, you don't have to do it every time , But one thing to note is that this is related to gpu of , That computer makes reasoning , Just use which computer to do these three .
2)TensorRT Deploy
TensorRT Develop Chinese manuals
TensorRT Professional introduction
TensorRT course
边栏推荐
- Fundamentals of software testing
- Elevator dispatching (pairing project) ③
- 本地Mysql忘记密码的修改方法(windows)
- Capl: timer event
- Exceptions and exception handling
- Usage of with as
- Summary of automated testing framework
- Canoe: the difference between environment variables and system variables
- 51 data analysis post
- Local MySQL forget password modification method (Windows) [easy to understand]
猜你喜欢
Day01 preliminary packet capture
Appscan installation error: unable to install from Net runtime security policy logout appscan solution
2021 annual summary - it seems that I have done everything except studying hard
Take advantage of the world's sleeping gap to improve and surpass yourself -- get up early
Failed to configure a DataSource: ‘url‘ attribute is not specified... Bug solution
Discussion | has large AI become autonomous? Lecun, chief scientist of openai
Summary of Shanghai Jiaotong University postgraduate entrance examination module -- cryptography
Oracle11g | getting started with database. It's enough to read this 10000 word analysis
Deepmind proposed a Zuan AI, which specially outputs network attack language
JMeter assembly point technology and logic controller
随机推荐
JMeter Foundation
OSI seven layer reference model
Global function Encyclopedia
unit testing
How to deal with the relationship between colleagues
2022 AAAI fellow release! Yan Shuicheng, chief scientist of sail, and Feng Yan, Professor of Hong Kong University of science and technology, were selected
Deepmind proposed a Zuan AI, which specially outputs network attack language
Failed to configure a DataSource: ‘url‘ attribute is not specified... Bug solution
Process communication and thread explanation
VPS安装Virtualmin面板
Replace() function
LxC shared directory permission configuration
1. Circular nesting and understanding of lists
Summary of automated testing framework
Common system modules and file operations
SQL greatest() function instance detailed example
Swagger and OpenAPI
QQ get group member operation time
Elevator dispatching (pairing project) ②
QQ group administrators