Docs
» Requirements and Installa on
Requirements and Installation
This page describes the requirements and installa on steps for Transfer Learning Toolkit (TLT).
Hardware Requirements
TLT has the following hardware requirements:
Recommended
32 GB system RAM
32 GB of GPU RAM
8 core CPU
1 NVIDIA GPU
100 GB of SSD space
TLT is supported on A10/A40/A100, V100 and RTX 30x0 GPUs.
Software Requirements
TLT has the following so ware requirements:
Ubuntu 18.04 LTS
NVIDIA GPU Cloud
account and API key
docker-ce
nvidia docker
Perform the following prerequisite steps before installing TLT:
1. Install Docker.
2. Install NVIDIA GPU driver v455.xx or above.
3. Install nvidia docker
4. Get an
NGC
account and API key:
a. Go to NGC and click the Transfer Learning Toolkit container in the Catalog tab. This
message is displayed: “Sign in to access the PULL feature of this repository”.
b. Enter your Email address and click Next, or click Create an Account.
c. Choose your organiza on when prompted for Organiza on/Team.
d. Click Sign In.
4. Execute
docker login nvcr.iofrom the command line and enter these login creden als:
a. Username: “$oauthtoken”
b. Password: “YOUR_NGC_API_KEY”
Getting Started With TLT
1. Prerequisites
Install virtualenv with python 3.6.9:
To setup the python virtual environment, please follow these
instruc ons
. Once
virtualenvwrapper is setup, please set the version of python to be used in the virtual env by
using the
VIRTUALENVWRAPPER_PYTHONvariable. You may do so by running
export VIRTUALENVWRAPPER_PYTHON=/path/to/bin/python3.x
where x >= 6 and <= 8
Instan ate a virtual environment using the below
where x >= 6 and <= 8
2. Download Jupyter Notebook
TLT provides samples notebooks to walk through an prescrible TLT workflow. These samples are
hosted on NGC as a resource and can be downloaded from NGC by execu ng the command
men oned below.
wget --content-disposition
https://api.ngc.nvidia.com/v2/resources/nvidia/tlt_cv_samples/versions/v1.0/zip -O tlt_cv_samples_v1.0.zip
The list with their corresponding samples mapped are men oned below.
Model Name
Jupyter Notebook
VehicleTypeNet
classifica on
VehicleMakeNet
classifica on
TrafficCamNet
detectnet_v2
PeopleSegNet
mask_rcnn
PeopleNet
detectnet
License Plate Recogni on
lprnet
License Plate Detec on
detectnet_v2
Heart Rate Es ma on
heartratenet
Gesture Recogni on
gesturenet
Gaze Es ma on
gazenet
Facial Landmark
fpenet
FaceDetectIR
detectnet_v2
FaceDetect
facenet
DashCamNet
dashcamnet
Open model architecture:
Open model architecture
Jupyter notebook
DetectNet_v2
detectnet_v2
FasterRCNN
faster_rcnn
YOLOV3
yolo_v3
YOLOV4
yolo_v4
SSD
ssd
DSSD
dssd
Re naNet
re nanet
MaskRCNN
mask_rcnn
UNET
unet
Classifica on
classifica on
3. Start Jupyter Notebook
Once the notebook samples are downloaded, you may start the notebook using below
commands:
jupyter notebook --ip 0.0.0.0 --port 8888 --allow-root
Open the internet browser on localhost and type the url wri en below:
http://0.0.0.0:8888
If you want to run the notebook from a remote server then please follow these
steps
.
4. Train the Model
Follow the Notebook instruc ons to train the model. Once the model is trained, export the .tlt
model to .etlt using below command:
tlt model_name export \
-m $USER_EXPERIMENT_DIR/experiment_dir_pruned/trained_model.tlt \
-o $USER_EXPERIMENT_DIR/experiment_dir_final/trained_model.etlt \
-k $KEY
Deepstream will use the exported .etlt model for inference.
Deepstream - TLT Integration
This sec on will describe how to integrate TLT models with Deepstream.
Prerequisites
Install
Deepstream
.
Download and install DeepStream SDK or use
DeepStream docker image
. Follow the
instruc ons men oned in the
quick start guide
.
Application files
To run the TLT model with Deepstream, below are the list of files required for each applica on.
Deepstream Pipeline: deepstream_applica on.c
Custom parser func on for post-processing :
nvdsinfer_customparser_$(MODEL)_tltTLT Models
1. Deepstream Pipeline:
Create a deepstream pipeline in deepstream_applica on.c. Sample applica ons can be found at
NVIDIA-AI-IOT tlt applica on
and
NVIDIA-AI-IOT lpr-lpd applica on
.
2. Create Custom Parser:
Create a nvdsinfer_customparser_$(MODEL)_tlt for post processing. Sample parsers can be
found at
NVIDIA-AI-IOT
3. TLT Models:
Use the .etlt model which was generated with TLT export.
Note
For Unet model and LPR model, you must convert the etlt model to TensorRT engine file
using tlt-convert like following:
tlt-converter -k nvidia_tlt -p image_input,1x3x48x96,4x3x48x96,16x3x48x96 ./us_lprnet_baseline18_deployable.etlt -t fp16 -e lpr_us_onnx_b16.engine tlt-converter -e models/unet/unet_resnet18.etlt_b1_gpu0_fp16.engine -p
input_1,1x3x608x960,1x3x608x960,1x3x608x960 -t fp16 -k tlt_encode -m 1 tlt_encode models/unet/unet_resnet18.etlt
4. Model configuration files:
The DeepStream configura on file includes some run me parameters for DeepStream nvinfer
plugin, such as model path, label file path, TensorRT inference precision, input and output node
names, input dimensions and so on. In this sample, each model has its own DeepStream
configura on file, e.g. pgie_dssd_tlt_config.txt for DSSD model. Please refer to DeepStream
Development Guide for detailed explana ons of those parameters.
Build and Run the application:
Build Parser
cd /opt/nvidia/deepstream/deepstream-5.0/sources/application/nvdsinfer_customparser_$(MODEL)_tlt make cp nvdsinfer_customparser_$(MODEL)_tlt.so /opt/nvidia/deepstream/deepstream-5.0/libBuild Applica on
cd /opt/nvidia/deepstream/deepstream-5.0/sources/apps/application makeRun the Applica on
./application_name --args
Resources
Deepstream-TLT PeopleNet model Deployment
Deepstream-TLT TrafficCamNet model Deployment
TrafficCamNet
Deepstream-TLT DashCamNet model deployment
## Download Model:mkdir -p $HOME/peoplenet && \
wget https://api.ngc.nvidia.com/v2/models/nvidia/tlt_peoplenet/versions/pruned_v1.0/files/resnet34_peoplen \ -O $HOME/peoplenet/resnet34_peoplenet_pruned.etlt ## Run Application xhost +
docker run --gpus all -it --rm -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY -v
$HOME:/opt/nvidia/deepstream/deepstream-5.0/samples/models/tlt_pretrained_models \
-w /opt/nvidia/deepstream/deepstream-5.0/samples/configs/tlt_pretrained_models nvcr.io/nvidia/deepstream:5.0.1-20.09-samples \
deepstream-app -c deepstream_app_source1_peoplenet.txt
## Download Model:
mkdir -p $HOME/trafficcamnet && \
wget
https://api.ngc.nvidia.com/v2/models/nvidia/tlt_trafficcamnet/versions/pruned_v1.0/files/resnet18_tra
\
-O $HOME/trafficcamnet/resnet18_trafficcamnet_pruned.etlt && \
wget https://api.ngc.nvidia.com/v2/models/nvidia/tlt_trafficcamnet/versions/pruned_v1.0/files/trafficnet_i \ -O $HOME/trafficcamnet/trafficnet_int8.txt ## Run Application xhost +
docker run --gpus all -it --rm -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY -v
$HOME:/opt/nvidia/deepstream/deepstream-5.0/samples/models/tlt_pretrained_models \
-w /opt/nvidia/deepstream/deepstream-5.0/samples/configs/tlt_pretrained_models nvcr.io/nvidia/deepstream:5.0.1-20.09-samples \
DashCamNet
Deepstream-TLT FaceDetectIR model deployment
FaceDetectIR
## Download Model:mkdir -p $HOME/dashcamnet && \
wget
https://api.ngc.nvidia.com/v2/models/nvidia/tlt_dashcamnet/versions/pruned_v1.0/files/resnet18_dashca
\
-O $HOME/dashcamnet/resnet18_dashcamnet_pruned.etlt && \
wget
https://api.ngc.nvidia.com/v2/models/nvidia/tlt_dashcamnet/versions/pruned_v1.0/files/dashcamnet_int8
\
-O $HOME/dashcamnet/dashcamnet_int8.txt mkdir -p $HOME/vehiclemakenet && \
wget
https://api.ngc.nvidia.com/v2/models/nvidia/tlt_vehiclemakenet/versions/pruned_v1.0/files/resnet18_ve
\
-O $HOME/vehiclemakenet/resnet18_vehiclemakenet_pruned.etlt && \
wget
https://api.ngc.nvidia.com/v2/models/nvidia/tlt_vehiclemakenet/versions/pruned_v1.0/files/vehiclemake
\
-O $HOME/vehiclemakenet/vehiclemakenet_int8.txt mkdir -p $HOME/vehicletypenet && \
wget
https://api.ngc.nvidia.com/v2/models/nvidia/tlt_vehicletypenet/versions/pruned_v1.0/files/resnet18_ve
\
-O $HOME/vehicletypenet/resnet18_vehicletypenet_pruned.etlt && \
wget https://api.ngc.nvidia.com/v2/models/nvidia/tlt_vehicletypenet/versions/pruned_v1.0/files/vehicletype \ -O $HOME/vehicletypenet/vehicletypenet_int8.txt ## Run Application xhost +
docker run --gpus all -it --rm -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY -v
$HOME:/opt/nvidia/deepstream/deepstream-5.0/samples/models/tlt_pretrained_models \
-w /opt/nvidia/deepstream/deepstream-5.0/samples/configs/tlt_pretrained_models nvcr.io/nvidia/deepstream:5.0.1-20.09-samples \
Deepstream-TLT apps
.
## Download Modelmkdir -p $HOME/facedetectir && \
wget
https://api.ngc.nvidia.com/v2/models/nvidia/tlt_facedetectir/versions/pruned_v1.0/files/resnet18_face
\
-O $HOME/facedetectir/resnet18_facedetectir_pruned.etlt && \
wget https://api.ngc.nvidia.com/v2/models/nvidia/tlt_facedetectir/versions/pruned_v1.0/files/facedetectir_ \ -O $HOME/facedetectir/facedetectir_int8.txt ## Run Application xhost +
docker run --gpus all -it --rm -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY -v
$HOME:/opt/nvidia/deepstream/deepstream-5.0/samples/models/tlt_pretrained_models \
-w /opt/nvidia/deepstream/deepstream-5.0/samples/configs/tlt_pretrained_models nvcr.io/nvidia/deepstream:5.0.1-20.09-samples \