All Projects → dkorobchenko-nv → Tensorrt Demo

dkorobchenko-nv / Tensorrt Demo

TensorRT and TensorFlow demo/example (python, jupyter notebook)

Projects that are alternatives of or similar to Tensorrt Demo

Data Science Foundations
Stars: ✭ 69 (-1.43%)
Mutual labels:  jupyter-notebook
Ensae teaching cs
Teaching materials in python at the @ENSAE
Stars: ✭ 69 (-1.43%)
Mutual labels:  jupyter-notebook
Feature Engineering Book
『機械学習のための特徴量エンジニアリング』のサンプルコード集
Stars: ✭ 70 (+0%)
Mutual labels:  jupyter-notebook
Pycon2017
Bayesian Machine Learning, https://us.pycon.org/2017/schedule/presentation/232/
Stars: ✭ 69 (-1.43%)
Mutual labels:  jupyter-notebook
Ml101
intro to machine learning - reverse engineering phenomena
Stars: ✭ 69 (-1.43%)
Mutual labels:  jupyter-notebook
Starter Academic
🎓 Easily create a beautiful academic résumé or educational website using Hugo, GitHub, and Netlify
Stars: ✭ 1,158 (+1554.29%)
Mutual labels:  jupyter-notebook
Cnn Interpretability
🏥 Visualizing Convolutional Networks for MRI-based Diagnosis of Alzheimer’s Disease
Stars: ✭ 68 (-2.86%)
Mutual labels:  jupyter-notebook
Learning Journey
Chisel Learning Journey
Stars: ✭ 70 (+0%)
Mutual labels:  jupyter-notebook
Nyumath2048
NYU Math-GA 2048: Scientific Computing in Finance
Stars: ✭ 69 (-1.43%)
Mutual labels:  jupyter-notebook
Impulcifer
Measurement and processing of binaural impulse responses for personalized surround virtualization on headphones.
Stars: ✭ 70 (+0%)
Mutual labels:  jupyter-notebook
Recommender
A recommendation system using tensorflow
Stars: ✭ 69 (-1.43%)
Mutual labels:  jupyter-notebook
Gds env
A containerised platform for Geographic Data Science
Stars: ✭ 68 (-2.86%)
Mutual labels:  jupyter-notebook
Handson Ml2
https://github.com/ageron/handson-ml2
Stars: ✭ 70 (+0%)
Mutual labels:  jupyter-notebook
Pycon time series
PyCon 2017 tutorial on time series analysis
Stars: ✭ 69 (-1.43%)
Mutual labels:  jupyter-notebook
Group Level Emotion Recognition
Model submitted for the ICMI 2018 EmotiW Group-Level Emotion Recognition Challenge
Stars: ✭ 70 (+0%)
Mutual labels:  jupyter-notebook
Dsb17 Walkthrough
An end-to-end walkthrough of the winning submission by grt123 for the Kaggle Data Science Bowl 2017
Stars: ✭ 69 (-1.43%)
Mutual labels:  jupyter-notebook
Lhy dl hw
Stars: ✭ 1,150 (+1542.86%)
Mutual labels:  jupyter-notebook
Invertinggan
Invert a pre-trained GAN model (includes code for training a GAN on celebA)
Stars: ✭ 70 (+0%)
Mutual labels:  jupyter-notebook
Disease Prediction From Symptoms
Disease Prediction based on Symptoms.
Stars: ✭ 70 (+0%)
Mutual labels:  jupyter-notebook
Coding Ninjas Data Structures And Algorithms In Python
Solved problems and assignments of DSA course taught by Coding Ninjas team
Stars: ✭ 70 (+0%)
Mutual labels:  jupyter-notebook

TensorRT Demo

The demo shows how to build, train and test a ConvNet using TensorFlow and then how to port it to TensorRT for fast inference.

There are two ways to perform the TensorRT optimization:

  • Build a stand-alone TensorRT engine
  • Use TensorRT+TensorFlow to build a new TF graph with optimized TRT-based subgraphs

For each step there is a py script and a Jupyter Notebook ipynb

Parameters, which could be adjusted, are marked with # ADJUST comment

TensorFlow part

Requirements: It is recommended to run everything inside tensorflow docker container (see docker details below)

TensorFlow train

Build and train a ConvNet using Tensorflow

Jupyter version: Tensorflow_train.ipynb

Python version: tf_train.py

TensorFlow graph freeze

Prepare TF graph for the inference procedure (mostly required for the further porting to TensorRT)

Jupyter version: Tensorflow_freeze.ipynb

Python version: tf_freeze.py

TensorFlow inference

Perform inference by means of TensorFlow. There are two modes: TF and TRT, which mean regular TF graph and TF graph with TRT optimizations correspondingly. The second will be available after the TensorFlow optimize step.

Jupyter version: Tensorflow_infer.ipynb

Python version: tf_infer.py

TensorFlow optimize

Use TensorRT+TensorFlow to build a new TF graph with optimized TRT-based subgraphs

Jupyter version: Tensorflow_optimize.ipynb

Python version: tf_optimize.py

TensorRT part

Requirements: It is recommended to run everything inside tensorrt docker container (see docker details below)

TensorRT optimize

Optimize frozen TF graph and prepare a stand-alone TensorRT inference engine

Jupyter version: TensorRT_optimize.ipynb

Python version: trt_optimize.py

TensorRT inference

Inference by means of TensorRT

Jupyter version: TensorRT_infer.ipynb

Python version: trt_infer.py

Docker

To avoid problems with various versions of the frameworks, it is recommended to use docker containers.

There are two containers with the following Dockerfiles:

  • tensorflow.Dockerfile contains TensorFlow 1.10 built against CUDA 10. This container is recommended for all steps from TensorFlow part
  • tensorrt.Dockerfile contains TensorRT 5.0. This container is recommended for all steps from TensorRT part

You can use either standard docker commands or docker-compose. Below is the way using standard commands.

To build docker containers use docker_build.sh

To run a docker container in bash mode (useful for python scripts) use docker_run_bash.sh TF or docker_run_bash.sh TRT

To run a docker container in jupyter mode (useful for jupyer notebooks) use docker_run_jupyter.sh TF or docker_run_jupyter.sh TRT

Jupyter notebook password is set in .env file

Jupyter notebook ports:

  • 8881 for TensorFlow container
  • 8882 for TensorRT container

Training data

The training is performed on the ImageNet dataset (ILSVRC2012, http://image-net.org). In particular, on the ImageNet subset "Tabby cat" and "Bernese mountain dog" (cats vs dogs).

You can change TRAIN_DATA_ROOT and TRAIN_LIST_FILE variables according to your localtion of the ImageNet dataset, or create a symlink /imagenet/ pointing to your location of the ImageNet.

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].