All Projects → csvance → keras-tensorrt-jetson

csvance / keras-tensorrt-jetson

Licence: MIT license
Example of loading a Keras model into TensorRT C++ API

Programming Languages

Jupyter Notebook
11667 projects
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to keras-tensorrt-jetson

Torch2trt
An easy to use PyTorch to TensorRT converter
Stars: ✭ 2,974 (+5731.37%)
Mutual labels:  tensorrt, jetson-tx2
Jetson Inference
Hello AI World guide to deploying deep-learning inference networks and deep vision primitives with TensorRT and NVIDIA Jetson.
Stars: ✭ 5,191 (+10078.43%)
Mutual labels:  tensorrt, jetson-tx2
tensorrt-ssd-easy
No description or website provided.
Stars: ✭ 32 (-37.25%)
Mutual labels:  tensorrt
nvidia-jetson-rt
Real-Time Scheduling with NVIDIA Jetson TX2
Stars: ✭ 38 (-25.49%)
Mutual labels:  jetson-tx2
pnn
pnn is Darknet compatible neural nets inference engine implemented in Rust.
Stars: ✭ 17 (-66.67%)
Mutual labels:  tensorrt
torch-model-compression
针对pytorch模型的自动化模型结构分析和修改工具集,包含自动分析模型结构的模型压缩算法库
Stars: ✭ 126 (+147.06%)
Mutual labels:  tensorrt
installROS
Install ROS Melodic on NVIDIA Jetson Development Kits
Stars: ✭ 75 (+47.06%)
Mutual labels:  jetson-tx2
yolov5 tensorrt
This is the implementation that supports yolov5s, yolov5m, yolov5l, yolov5x.
Stars: ✭ 32 (-37.25%)
Mutual labels:  tensorrt
YOLOP
You Only Look Once for Panopitic Driving Perception.(https://arxiv.org/abs/2108.11250)
Stars: ✭ 1,228 (+2307.84%)
Mutual labels:  jetson-tx2
yolov5 tensorrt int8
TensorRT int8 量化部署 yolov5s 模型,实测3.3ms一帧!
Stars: ✭ 112 (+119.61%)
Mutual labels:  tensorrt
MutualGuide
Localize to Classify and Classify to Localize: Mutual Guidance in Object Detection
Stars: ✭ 97 (+90.2%)
Mutual labels:  tensorrt
InsightFace-REST
InsightFace REST API for easy deployment of face recognition services with TensorRT in Docker.
Stars: ✭ 308 (+503.92%)
Mutual labels:  tensorrt
ros-yolo-sort
YOLO v3, v4, v5, v6, v7 + SORT tracking + ROS platform. Supporting: YOLO with Darknet, OpenCV(DNN), OpenVINO, TensorRT(tkDNN). SORT supports python(original) and C++. (Not Deep SORT)
Stars: ✭ 162 (+217.65%)
Mutual labels:  tensorrt
self-driving-ish computer vision system
This project generates images you've probably seen in autonomous driving demo. Object Detection, Lane Detection, Road Segmentation, Depth Estimation using TensorRT
Stars: ✭ 254 (+398.04%)
Mutual labels:  tensorrt
deepvac
PyTorch Project Specification.
Stars: ✭ 507 (+894.12%)
Mutual labels:  tensorrt
jetson-tx2-pytorch
Installing PyTorch on the Nvidia Jetson TX1/TX2
Stars: ✭ 74 (+45.1%)
Mutual labels:  jetson-tx2
gpuGraphTX
Simple moving graph of GPU activity for the Jetson TX1 and Jetson TX2
Stars: ✭ 92 (+80.39%)
Mutual labels:  jetson-tx2
yolov4 trt ros
YOLOv4 object detector using TensorRT engine
Stars: ✭ 89 (+74.51%)
Mutual labels:  tensorrt
DLARM
DLARM: Dissertation for Computer Science Masters Degree at UFRGS
Stars: ✭ 24 (-52.94%)
Mutual labels:  jetson-tx2
flexinfer
A flexible Python front-end inference SDK based on TensorRT
Stars: ✭ 83 (+62.75%)
Mutual labels:  tensorrt

keras-tensorrt-jetson

nVidia's Jetson platform is arguably the most powerful family of devices for deep learning at the edge. In order to achieve the full benefits of the platform, a framework called TensorRT drastically reduces inference time for supported network architectures and layers. However, nVidia does not currently make it easy to take your existing models from Keras/Tensorflow and deploy them on the Jetson with TensorRT. One reason for this is the python API for TensorRT only supports x86 based architectures. This leaves us with no real easy way of taking advantage of the benefits of TensorRT. However, there is a harder way that does work: To achieve maximum inference performance we can export and convert our model to .uff format, and then load it in TensorRT's C++ API.

1. Training and exporting to .pb

  • Train your model
  • If using Jupyter, restart the kernel you trained your model in to remove training layers from the graph
  • Reload the models weights
  • Use an export function like the one in this notebook to export the graph to a .pb file

2. Converting .pb to .uff

I suggest using the chybhao666/cuda9_cudnn7_tensorrt3.0:latest Docker container to access the script needed for converting a .pb export from Keras/Tensorflow to .uff format for TensorRT import.

cd /usr/lib/python2.7/dist-packages/uff/bin
# List Layers and manually pick out the output layer
# For most networks it will be dense_x/BiasAdd, the last one that isn't a placeholder or activation layer
python convert_to_uff.py tensorflow --input-file /path/to/graph.pb -l

# Convert to .uff, replace dense_1/BiasAdd with the name of your output layer
python convert_to_uff.py tensorflow -o /path/to/graph.uff --input-file /path/to/graph.pb -O dense_1/BiasAdd

More information on the .pb export and .uff conversion is available from nVidia

3. Loading the .uff into TensorRT C++ Inference API

I have create a generic class which can load the graph from a .uff file and setup TensorRT for inference. It supports any number of inputs and outputs and is available on my Github. It can be built with nVidia nSight Eclipse Edition using a remote toolchain (instructions here)

Caveats

  • Keep in mind that many layers are not supported by TensorRT 3.0. The most obvious omission is Keras particular implementation of BatchNorm.
  • Concatenate only works on the channel axis and if and only if the other dimensions are the same. If you have multiple paths for convolution, you are limited to concatenating them only when they have the same dimensions.

nVidia DIGITS TensorRT Inference Nodes for ROS

  • Support for DetectNet, ImageNet, and soon SegNet!
  • Includes a flexible abstraction layer for TensorRT
  • Github
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].