SlideShare a Scribd company logo
1 of 9
Download to read offline
Face recognition: OnnX to
TensorRT conversion of
Arcface Model
https://www.datatobiz.com/
I fail to run TensorRT inference on Jetson Nano, due to PReLU
activation function not supported for TensorRT 5.1. But, the
PReLU channel-wise operator is available for TensorRT 6. In
this blogpost, I will explain the steps required in the model
conversion of ONNX to TensorRT and the reason why my steps
failed to run TensorRT inference on Jetson Nano
Steps included to run
TensorRT inference on Jetson
Nano
1.The first step is to import the model, which includes loading it from
a saved file on disk and converting it to a TensorRT network from its
native framework or format.Our example loads the model in ONNX
format i.e. arcface model of face recognition.
2. Next, an optimized TensorRT engine is built based on the input
model, target GPU platform, and other configuration parameters
specified.
3. The last step is to provide input data to the TensorRT engine to
perform inference. The sample uses input data bundled with model
from the ONNX model zoo to perform inference.
Sample code
Firstly, ensure that ONNX is installed on Jetson Nano by running the
following command.
Now let’s convert the downloaded ONNX model into TensorRT
arcface_trt.engine.
TensorRT module is pre-installed on Jetson Nano. The current release of
TensorRT version is 5.1 by NVIDIA JetPack SDK.
1.
import ONNX
If this command gives an error, then ONNX is not installed on Jetson Nano.
Follow the steps to install ONNX on Jetson Nano:
sudo apt-get install cmake==3.2
sudo apt-get install protobuf-compiler
sudo apt-get install libprotoc-dev
pip install –no-binary ONNX ‘ONNX==1.5.0
Now, ONNX is ready to run on Jetson Nano satisfying all the dependencies.
2. Now, download the ONNX model using the following command:
wget https://s3.amazonaws.com/ONNX-model-
zoo/arcface/resnet100/resnet100.ONNX
3. Simply run the following script as a next step:
We are using Python API for the conversion.
import os
import tensorrt as trtbatch_size = 1
TRT_LOGGER = trt.Logger()
def build_engine_ONNX(model_file):
with trt.Builder(TRT_LOGGER) as builder, builder.create_network() as
network, trt.ONNXParser(network, TRT_LOGGER) as parser:
builder.max_workspace_size = 1 << 30
builder.max_batch_size = batch_size
# Load the ONNX model and parse it in order to populate the TensorRT
network.
with open(model_file, 'rb') as model:
parser.parse(model.read())
return builder.build_cuda_engine(network)
# downloaded the arcface mdoel
ONNX_file_path = './resnet100.ONNX'
engine = build_engine_ONNX(ONNX_file_path)
engine_file_path = './arcface_trt.engine'
with open(engine_file_path, "wb") as f:
f.write(engine.serialize())
After running the script, we get some error “Segmentation fault core
dumped”. After doing a lot of research we have found that there is no
issue with the script. There are some other reasons why we are facing
this problem.
Read further
https://www.datatobiz.com/blog/face-recognition-on-jetson-nano/

More Related Content

Similar to Face Recognition: ONNX to TensorRT conversion for Arcface model problem?

Introduction to TensorFlow and OpenCV libraries
Introduction to TensorFlow and OpenCV librariesIntroduction to TensorFlow and OpenCV libraries
Introduction to TensorFlow and OpenCV librariesTanikella Sai Abhijyan
 
Final training course
Final training courseFinal training course
Final training courseNoor Dhiya
 
Inference accelerators
Inference acceleratorsInference accelerators
Inference acceleratorsDarshanG13
 
Ccna cheat sheet
Ccna cheat sheetCcna cheat sheet
Ccna cheat sheetaromal4frnz
 
NetSim Technology Library - Software defined networks
NetSim Technology Library - Software defined networksNetSim Technology Library - Software defined networks
NetSim Technology Library - Software defined networksVishal Sharma
 
Attention mechanisms with tensorflow
Attention mechanisms with tensorflowAttention mechanisms with tensorflow
Attention mechanisms with tensorflowKeon Kim
 
Lab: Installation of Xilkernel on Xilinx Spartan 3E Starter board
Lab: Installation of Xilkernel on Xilinx Spartan 3E Starter boardLab: Installation of Xilkernel on Xilinx Spartan 3E Starter board
Lab: Installation of Xilkernel on Xilinx Spartan 3E Starter boardVincent Claes
 
How to Build Real-time Chat App with Express, ReactJS, and Socket.IO?
How to Build Real-time Chat App with Express, ReactJS, and Socket.IO?How to Build Real-time Chat App with Express, ReactJS, and Socket.IO?
How to Build Real-time Chat App with Express, ReactJS, and Socket.IO?Katy Slemon
 
Fault tolerance ease of setup comparison: NEC hardware-based FT vs. software-...
Fault tolerance ease of setup comparison: NEC hardware-based FT vs. software-...Fault tolerance ease of setup comparison: NEC hardware-based FT vs. software-...
Fault tolerance ease of setup comparison: NEC hardware-based FT vs. software-...Principled Technologies
 
Uni centa opos data transfer guide
Uni centa opos data transfer guideUni centa opos data transfer guide
Uni centa opos data transfer guideAlfonsoCueto
 
Flink Forward San Francisco 2019: Deploying ONNX models on Flink - Isaac Mcki...
Flink Forward San Francisco 2019: Deploying ONNX models on Flink - Isaac Mcki...Flink Forward San Francisco 2019: Deploying ONNX models on Flink - Isaac Mcki...
Flink Forward San Francisco 2019: Deploying ONNX models on Flink - Isaac Mcki...Flink Forward
 
maXbox Starter 42 Multiprocessing Programming
maXbox Starter 42 Multiprocessing Programming maXbox Starter 42 Multiprocessing Programming
maXbox Starter 42 Multiprocessing Programming Max Kleiner
 
the NML project
the NML projectthe NML project
the NML projectLei Yang
 
International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)ijceronline
 
Install .Net Core, SQL Server V-Next on Linux and deploy .Net core applicatio...
Install .Net Core, SQL Server V-Next on Linux and deploy .Net core applicatio...Install .Net Core, SQL Server V-Next on Linux and deploy .Net core applicatio...
Install .Net Core, SQL Server V-Next on Linux and deploy .Net core applicatio...Ajith Ramawickrama
 

Similar to Face Recognition: ONNX to TensorRT conversion for Arcface model problem? (20)

Introduction to TensorFlow and OpenCV libraries
Introduction to TensorFlow and OpenCV librariesIntroduction to TensorFlow and OpenCV libraries
Introduction to TensorFlow and OpenCV libraries
 
Final training course
Final training courseFinal training course
Final training course
 
Inference accelerators
Inference acceleratorsInference accelerators
Inference accelerators
 
Cisco CCENT Cram Notes
Cisco CCENT Cram NotesCisco CCENT Cram Notes
Cisco CCENT Cram Notes
 
Ccna cheat sheet
Ccna cheat sheetCcna cheat sheet
Ccna cheat sheet
 
NetSim Technology Library - Software defined networks
NetSim Technology Library - Software defined networksNetSim Technology Library - Software defined networks
NetSim Technology Library - Software defined networks
 
Attention mechanisms with tensorflow
Attention mechanisms with tensorflowAttention mechanisms with tensorflow
Attention mechanisms with tensorflow
 
snortinstallguide
snortinstallguidesnortinstallguide
snortinstallguide
 
Lab: Installation of Xilkernel on Xilinx Spartan 3E Starter board
Lab: Installation of Xilkernel on Xilinx Spartan 3E Starter boardLab: Installation of Xilkernel on Xilinx Spartan 3E Starter board
Lab: Installation of Xilkernel on Xilinx Spartan 3E Starter board
 
How to Build Real-time Chat App with Express, ReactJS, and Socket.IO?
How to Build Real-time Chat App with Express, ReactJS, and Socket.IO?How to Build Real-time Chat App with Express, ReactJS, and Socket.IO?
How to Build Real-time Chat App with Express, ReactJS, and Socket.IO?
 
Nrpe
NrpeNrpe
Nrpe
 
Fault tolerance ease of setup comparison: NEC hardware-based FT vs. software-...
Fault tolerance ease of setup comparison: NEC hardware-based FT vs. software-...Fault tolerance ease of setup comparison: NEC hardware-based FT vs. software-...
Fault tolerance ease of setup comparison: NEC hardware-based FT vs. software-...
 
Uni centa opos data transfer guide
Uni centa opos data transfer guideUni centa opos data transfer guide
Uni centa opos data transfer guide
 
The power of dots
The power of dotsThe power of dots
The power of dots
 
Flink Forward San Francisco 2019: Deploying ONNX models on Flink - Isaac Mcki...
Flink Forward San Francisco 2019: Deploying ONNX models on Flink - Isaac Mcki...Flink Forward San Francisco 2019: Deploying ONNX models on Flink - Isaac Mcki...
Flink Forward San Francisco 2019: Deploying ONNX models on Flink - Isaac Mcki...
 
maXbox Starter 42 Multiprocessing Programming
maXbox Starter 42 Multiprocessing Programming maXbox Starter 42 Multiprocessing Programming
maXbox Starter 42 Multiprocessing Programming
 
the NML project
the NML projectthe NML project
the NML project
 
International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)
 
Install .Net Core, SQL Server V-Next on Linux and deploy .Net core applicatio...
Install .Net Core, SQL Server V-Next on Linux and deploy .Net core applicatio...Install .Net Core, SQL Server V-Next on Linux and deploy .Net core applicatio...
Install .Net Core, SQL Server V-Next on Linux and deploy .Net core applicatio...
 
Lesson 2
Lesson 2Lesson 2
Lesson 2
 

More from Kavika Roy

Top 5 Travel Analytics Solutions Companies.pptx
Top 5 Travel Analytics Solutions Companies.pptxTop 5 Travel Analytics Solutions Companies.pptx
Top 5 Travel Analytics Solutions Companies.pptxKavika Roy
 
Transforming Hotel Data Analytics with a Resilient Datawarehouse.pptx
Transforming Hotel Data Analytics with a Resilient Datawarehouse.pptxTransforming Hotel Data Analytics with a Resilient Datawarehouse.pptx
Transforming Hotel Data Analytics with a Resilient Datawarehouse.pptxKavika Roy
 
6 Top Real Estate Managed Analytics Service Providers.pptx
6 Top Real Estate Managed Analytics Service Providers.pptx6 Top Real Estate Managed Analytics Service Providers.pptx
6 Top Real Estate Managed Analytics Service Providers.pptxKavika Roy
 
Top Manufacturing Analytics solutions providers for US Startups.pptx
Top Manufacturing Analytics solutions providers for US Startups.pptxTop Manufacturing Analytics solutions providers for US Startups.pptx
Top Manufacturing Analytics solutions providers for US Startups.pptxKavika Roy
 
Top 10 Analytics & BI Consultants in Manufacturing.pptx
Top 10 Analytics & BI Consultants in Manufacturing.pptxTop 10 Analytics & BI Consultants in Manufacturing.pptx
Top 10 Analytics & BI Consultants in Manufacturing.pptxKavika Roy
 
Top 5 data warehousing consulting companies for US travel and tourism.pptx
Top 5 data warehousing consulting companies for US travel and tourism.pptxTop 5 data warehousing consulting companies for US travel and tourism.pptx
Top 5 data warehousing consulting companies for US travel and tourism.pptxKavika Roy
 
6 Top UK Real Estate Analytics Firms.pptx
6 Top UK Real Estate Analytics Firms.pptx6 Top UK Real Estate Analytics Firms.pptx
6 Top UK Real Estate Analytics Firms.pptxKavika Roy
 
eCommerce Managed Analytics companies.pptx
eCommerce Managed Analytics companies.pptxeCommerce Managed Analytics companies.pptx
eCommerce Managed Analytics companies.pptxKavika Roy
 
10 Common myths in affiliate marketing.pptx
10 Common myths in affiliate marketing.pptx10 Common myths in affiliate marketing.pptx
10 Common myths in affiliate marketing.pptxKavika Roy
 
Real world Examples of AI Products in action
Real world Examples of AI Products in actionReal world Examples of AI Products in action
Real world Examples of AI Products in actionKavika Roy
 
Mastering Affiliate Marketing- A Strategic Journey (1).pptx
Mastering Affiliate Marketing- A Strategic Journey (1).pptxMastering Affiliate Marketing- A Strategic Journey (1).pptx
Mastering Affiliate Marketing- A Strategic Journey (1).pptxKavika Roy
 
Building AI product from Scratch for C-level Executives
Building AI product from Scratch for C-level ExecutivesBuilding AI product from Scratch for C-level Executives
Building AI product from Scratch for C-level ExecutivesKavika Roy
 
"2024 Side Hustles: Diversify Income, Monetize Passion!"
"2024 Side Hustles: Diversify Income, Monetize Passion!""2024 Side Hustles: Diversify Income, Monetize Passion!"
"2024 Side Hustles: Diversify Income, Monetize Passion!"Kavika Roy
 
What are the Six Big Losses in OEE? - By DataToBiz
What are the Six Big Losses in OEE? - By DataToBizWhat are the Six Big Losses in OEE? - By DataToBiz
What are the Six Big Losses in OEE? - By DataToBizKavika Roy
 
Types of Data Engineering Services - By DataToBiz
Types of Data Engineering Services - By DataToBizTypes of Data Engineering Services - By DataToBiz
Types of Data Engineering Services - By DataToBizKavika Roy
 
Top Business Intelligence Trends - By DataToBiz
Top Business Intelligence Trends - By DataToBizTop Business Intelligence Trends - By DataToBiz
Top Business Intelligence Trends - By DataToBizKavika Roy
 
How to use PrepAI to Generate HOTS Questions? - By PrepAI
How to use PrepAI to Generate HOTS Questions? - By PrepAIHow to use PrepAI to Generate HOTS Questions? - By PrepAI
How to use PrepAI to Generate HOTS Questions? - By PrepAIKavika Roy
 
5 Ways to Develop Metacognitive Skills - By PrepAI
5 Ways to Develop Metacognitive Skills - By PrepAI5 Ways to Develop Metacognitive Skills - By PrepAI
5 Ways to Develop Metacognitive Skills - By PrepAIKavika Roy
 
Methods to Upskill and Reskill Your Employees.pdf
Methods to Upskill and Reskill Your Employees.pdfMethods to Upskill and Reskill Your Employees.pdf
Methods to Upskill and Reskill Your Employees.pdfKavika Roy
 
Common eLearning Challenges and Solutions- By PrepAI
Common eLearning Challenges and Solutions- By PrepAICommon eLearning Challenges and Solutions- By PrepAI
Common eLearning Challenges and Solutions- By PrepAIKavika Roy
 

More from Kavika Roy (20)

Top 5 Travel Analytics Solutions Companies.pptx
Top 5 Travel Analytics Solutions Companies.pptxTop 5 Travel Analytics Solutions Companies.pptx
Top 5 Travel Analytics Solutions Companies.pptx
 
Transforming Hotel Data Analytics with a Resilient Datawarehouse.pptx
Transforming Hotel Data Analytics with a Resilient Datawarehouse.pptxTransforming Hotel Data Analytics with a Resilient Datawarehouse.pptx
Transforming Hotel Data Analytics with a Resilient Datawarehouse.pptx
 
6 Top Real Estate Managed Analytics Service Providers.pptx
6 Top Real Estate Managed Analytics Service Providers.pptx6 Top Real Estate Managed Analytics Service Providers.pptx
6 Top Real Estate Managed Analytics Service Providers.pptx
 
Top Manufacturing Analytics solutions providers for US Startups.pptx
Top Manufacturing Analytics solutions providers for US Startups.pptxTop Manufacturing Analytics solutions providers for US Startups.pptx
Top Manufacturing Analytics solutions providers for US Startups.pptx
 
Top 10 Analytics & BI Consultants in Manufacturing.pptx
Top 10 Analytics & BI Consultants in Manufacturing.pptxTop 10 Analytics & BI Consultants in Manufacturing.pptx
Top 10 Analytics & BI Consultants in Manufacturing.pptx
 
Top 5 data warehousing consulting companies for US travel and tourism.pptx
Top 5 data warehousing consulting companies for US travel and tourism.pptxTop 5 data warehousing consulting companies for US travel and tourism.pptx
Top 5 data warehousing consulting companies for US travel and tourism.pptx
 
6 Top UK Real Estate Analytics Firms.pptx
6 Top UK Real Estate Analytics Firms.pptx6 Top UK Real Estate Analytics Firms.pptx
6 Top UK Real Estate Analytics Firms.pptx
 
eCommerce Managed Analytics companies.pptx
eCommerce Managed Analytics companies.pptxeCommerce Managed Analytics companies.pptx
eCommerce Managed Analytics companies.pptx
 
10 Common myths in affiliate marketing.pptx
10 Common myths in affiliate marketing.pptx10 Common myths in affiliate marketing.pptx
10 Common myths in affiliate marketing.pptx
 
Real world Examples of AI Products in action
Real world Examples of AI Products in actionReal world Examples of AI Products in action
Real world Examples of AI Products in action
 
Mastering Affiliate Marketing- A Strategic Journey (1).pptx
Mastering Affiliate Marketing- A Strategic Journey (1).pptxMastering Affiliate Marketing- A Strategic Journey (1).pptx
Mastering Affiliate Marketing- A Strategic Journey (1).pptx
 
Building AI product from Scratch for C-level Executives
Building AI product from Scratch for C-level ExecutivesBuilding AI product from Scratch for C-level Executives
Building AI product from Scratch for C-level Executives
 
"2024 Side Hustles: Diversify Income, Monetize Passion!"
"2024 Side Hustles: Diversify Income, Monetize Passion!""2024 Side Hustles: Diversify Income, Monetize Passion!"
"2024 Side Hustles: Diversify Income, Monetize Passion!"
 
What are the Six Big Losses in OEE? - By DataToBiz
What are the Six Big Losses in OEE? - By DataToBizWhat are the Six Big Losses in OEE? - By DataToBiz
What are the Six Big Losses in OEE? - By DataToBiz
 
Types of Data Engineering Services - By DataToBiz
Types of Data Engineering Services - By DataToBizTypes of Data Engineering Services - By DataToBiz
Types of Data Engineering Services - By DataToBiz
 
Top Business Intelligence Trends - By DataToBiz
Top Business Intelligence Trends - By DataToBizTop Business Intelligence Trends - By DataToBiz
Top Business Intelligence Trends - By DataToBiz
 
How to use PrepAI to Generate HOTS Questions? - By PrepAI
How to use PrepAI to Generate HOTS Questions? - By PrepAIHow to use PrepAI to Generate HOTS Questions? - By PrepAI
How to use PrepAI to Generate HOTS Questions? - By PrepAI
 
5 Ways to Develop Metacognitive Skills - By PrepAI
5 Ways to Develop Metacognitive Skills - By PrepAI5 Ways to Develop Metacognitive Skills - By PrepAI
5 Ways to Develop Metacognitive Skills - By PrepAI
 
Methods to Upskill and Reskill Your Employees.pdf
Methods to Upskill and Reskill Your Employees.pdfMethods to Upskill and Reskill Your Employees.pdf
Methods to Upskill and Reskill Your Employees.pdf
 
Common eLearning Challenges and Solutions- By PrepAI
Common eLearning Challenges and Solutions- By PrepAICommon eLearning Challenges and Solutions- By PrepAI
Common eLearning Challenges and Solutions- By PrepAI
 

Recently uploaded

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Recently uploaded (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Face Recognition: ONNX to TensorRT conversion for Arcface model problem?

  • 1. Face recognition: OnnX to TensorRT conversion of Arcface Model https://www.datatobiz.com/
  • 2. I fail to run TensorRT inference on Jetson Nano, due to PReLU activation function not supported for TensorRT 5.1. But, the PReLU channel-wise operator is available for TensorRT 6. In this blogpost, I will explain the steps required in the model conversion of ONNX to TensorRT and the reason why my steps failed to run TensorRT inference on Jetson Nano
  • 3. Steps included to run TensorRT inference on Jetson Nano
  • 4. 1.The first step is to import the model, which includes loading it from a saved file on disk and converting it to a TensorRT network from its native framework or format.Our example loads the model in ONNX format i.e. arcface model of face recognition. 2. Next, an optimized TensorRT engine is built based on the input model, target GPU platform, and other configuration parameters specified. 3. The last step is to provide input data to the TensorRT engine to perform inference. The sample uses input data bundled with model from the ONNX model zoo to perform inference.
  • 6. Firstly, ensure that ONNX is installed on Jetson Nano by running the following command. Now let’s convert the downloaded ONNX model into TensorRT arcface_trt.engine. TensorRT module is pre-installed on Jetson Nano. The current release of TensorRT version is 5.1 by NVIDIA JetPack SDK. 1. import ONNX If this command gives an error, then ONNX is not installed on Jetson Nano. Follow the steps to install ONNX on Jetson Nano: sudo apt-get install cmake==3.2 sudo apt-get install protobuf-compiler sudo apt-get install libprotoc-dev pip install –no-binary ONNX ‘ONNX==1.5.0
  • 7. Now, ONNX is ready to run on Jetson Nano satisfying all the dependencies. 2. Now, download the ONNX model using the following command: wget https://s3.amazonaws.com/ONNX-model- zoo/arcface/resnet100/resnet100.ONNX 3. Simply run the following script as a next step: We are using Python API for the conversion. import os import tensorrt as trtbatch_size = 1 TRT_LOGGER = trt.Logger() def build_engine_ONNX(model_file): with trt.Builder(TRT_LOGGER) as builder, builder.create_network() as network, trt.ONNXParser(network, TRT_LOGGER) as parser: builder.max_workspace_size = 1 << 30 builder.max_batch_size = batch_size
  • 8. # Load the ONNX model and parse it in order to populate the TensorRT network. with open(model_file, 'rb') as model: parser.parse(model.read()) return builder.build_cuda_engine(network) # downloaded the arcface mdoel ONNX_file_path = './resnet100.ONNX' engine = build_engine_ONNX(ONNX_file_path) engine_file_path = './arcface_trt.engine' with open(engine_file_path, "wb") as f: f.write(engine.serialize()) After running the script, we get some error “Segmentation fault core dumped”. After doing a lot of research we have found that there is no issue with the script. There are some other reasons why we are facing this problem.