Hi,
I’ve set up the docker for the transfer learning. I’ve trained, pruned and retrained my model.
Then, I exported my model to the .etlt format.
This format seems to be usable only by DeepStream SDK.
Then, I set up the Deep Stream SDK and I have the : (deepstream-test-1-app, deepstream-test-2-app etc.) working.
In order to use the trained model with pruning(=transfert learning toolkit), I understand that i have to use thedeepstream-app.
I followed the readme files (got the.prototxt file, the iplugin.prototxt file & the VGG16faster_rcnn_final.caffemodel)
Things seems fine BUT i managed to have everything working thanks to this caffe model.
Where can i find a tutorial or some detailed steps where it is described how to use a CUSTOM .ETLT file:
a) what document to modify (config_infer_primary_fasterRCNN.txt ?)
b) what modifications to do?
Generate a device specific optimized TensorRT engine, using tlt-converter which may then be ingested by DeepStream
Integrate the model directly in the DeepStream environment using the exported model file(i.e etlt file) generated by tlt-export.
For your question, you already generate an etlt model. Please see the part “Integrating a FasterRCNN model” of the TLT started guide.
To run a FasterRCNN model in DeepStream, you need a label file and a DeepStream configure file. In addition, you need to compile FasterRCNN DeepStream plugin and sample app. A DeepStream sample with documentation on how to run inference using the trained FasterRCNN models from TLT is provided on github at: GitHub - NVIDIA-AI-IOT/deepstream_4.x_apps: deepstream 4.x samples to deploy TLT training models.
Then, modify pgie_frcnn_uff_config.txt inside it. For example, below etlt model path and your ngc key.
tlt-encoded-model=</path/to/etlt/model>
tlt-model-key=<key to decode the model>
If you use TRT engine to do inference, please disable above two lines and add below line into pgie_frcnn_uff_config.txt
model-engine-file= <TRT engine>
To do inference
$ ./deepstream-custom-uff-frcnn pgie_frcnn_uff_config.txt
Hi Thanks for your answer… I’ve tried for the last few days to follow the recommendation you gave me. - no success so far.
Just to put things in context: I was able to prune the model on a x86 Computer via the tLT, and I want to use Deepstream to do inference on the Jetson Xavier.
I followed the 2 steps you suggested.
I’ve tried with the *.etlt files : and I have a set of errors as displayed below.
I’ve tried to convert the files into TRT format (with tlt-converter) and try to use them on the Jetson. there is a minor mismatch between the converter and what Deepstream is expecting. (minor versions)
Based on the link u provided before:
a) can you confirm that .etlt file alone + the ngc key (= api key ?) is enough to “load” the model via the config file?
( is it possible to see a working example somewhere ? (i’ve been using the data supplied/shipped on that website and it is not working on my end)
b) in the folder where the shipped .etlt file is, I see a .pb file. Should we do something with that file? (convert it to uff?)
c) can you confirm that one can export the model via the TLT toolkit docker and use it later on for inference on a Jetson Xavier ?
Hi assansanogo,
Yes, I can confirm that one can export the model via the TLT toolkit docker and use it later on for inference on a Jetson Xavier.
For Faster-rcnn, I provide below steps for your reference.
If use exported model directly as above, ignore this step.
If want to generate TRT engine directly, in Jetson devices instead of x86, please download tlt-converter from dev-zone(https://developer.nvidia.com/tlt-converter) in order to generate a TRT engine. For example,run below command in xavier to generate an int8 trt engine. Input is “frcnn_kitti_retrain.int8.etlt” and "cal.bin ", the output is “frcnn_int8.engine”
$ ./tlt-converter frcnn_kitti_retrain.int8.etlt -e frcnn_int8.engine -k -c cal.bin -o dense_regress/BiasAdd,dense_class/Softmax,proposal -d 3,384,1280 -b 8 -m 4 -t int8 -i nchw
4.Generate label file
$ cat frcnn_labels.txt
Car
Pedestrian
Cyclist
background
5.Vim config file
$ cat pgie_frcnn_uff_config.txt
Hi,
i’m going to try your approach but just to understand:
all this tensor RT installation happens on the JETSON XAVIER right ? (TRT + TRT OSS)
"
Yes, I can confirm that one can export the model via the TLT toolkit docker and use it later on for inference on a Jetson Xavier.
For Faster-rcnn, I provide below steps for your reference.
1. As tlt doc mentioned, please follow https://github.com/NVIDIA-AI-IOT/deepstream_4.x_apps along with TRT OSS https://github.com/NVIDIA/TensorRT/tree/release/5.1 to compile FasterRCNN DeepStream plugin and sample app.
"
The TENSOR RT version available at ([…] …tree/release) is for amd right?
The Jetson Xavier is ARM based. What version should I download then? Should I not use the one (TRT 5.1) shipped with Jetpack?
Hi again,
Thanks for the previous hints : I’m getting closer to success, but so far : still 1 error.
a) I managed to have it working ( seeing bounding boxes) WITHOUT the custom parser activated ( in the pgie_frcnn_uff_config.txt )
As a result the bonding boxes are confinned at the top of the image.
b) I then realized that there are no layers called : dense_regress/BiasAdd or dense_SoftMax nor even proposal in the models supplied :
when one issue this command:
!tlt-pull -k $API_KEY -lm -o nvtltea -t iva
I have a collection of models available, but they don’t share the characteristics depicted in your previous answer. Where can we find the correct parser when the outputs are : “output_bbox/BiasAdd” and “output_cov/sigmoid”.
Does it mean I have to rewrite the customparser (difficult when we don’t know the logic behind the network) ?
c) I tried to look for specifically described “frcnn” with this command : !/workspace/ngc registry model list
I downloaded models but they are saved as .h5 or .hdf5. When i replace the path with these files. The tlt-training process fails.
What do I do wrong?
d) Is there somewhere : a downloadable version of the frcnn_kitti.tlt in order to recreate the example u described?
When I use the frcnn.etlt model supplied with https://github.com/NVIDIA-AI-IOT/deepstream_4.x_apps
it does not seem to work with the pgie.txt file
Am I doing something wrong?
Secondly, I assume you are deploying a Faster-rcnn network at the first time. So its output blob name should be “dense_class/Softmax,dense_regress/BiasAdd, proposal” . All the output blob names are listed as below.
For classification use: predictions/Softmax.
For detection: output_bbox/BiasAdd,output_cov/Sigmoid
For FasterRCNN: dense_class/Softmax,dense_regress/BiasAdd, proposal
Hi,
I was using the early access version T_T’, things should be alright now!!!
Keep you post once i’ve experimented with it!
Everything makes more sense (the custom parsers mismatch… etc.)
until next time.
Thanks for the hints.
AS