Failed to open TLT encoded model file

I got the following error trying to use a network that I retrain using the Transfer Learning Toolkit.

** WARN: <parse_gie:974>: Unknown key 'tlt-encoded-model' for group [secondary-gie0]

(deepstream-app:10312): GStreamer-WARNING **: 15:12:59.254: Name 'src_cap_filter' is not unique in bin 'src_sub_bin0', not adding

(deepstream-app:10312): GStreamer-WARNING **: 15:12:59.266: Name 'src_cap_filter' is not unique in bin 'src_sub_bin1', not adding

 *** DeepStream: Launched RTSP Streaming at rtsp://localhost:8554/ds-test ***

Unknown key 'gie-mode' for group [property]
Opening in BLOCKING MODE 
Creating LL OSD context new
0:00:01.246384739 10312   0x557b5d2470 INFO                 nvinfer gstnvinfer.cpp:519:gst_nvinfer_logger:<secondary_gie_0> NvDsInferContext[UID 2]:initialize(): Trying to create engine from model files
NvDsInferCudaEngineGetFromTltModel: Failed to open TLT encoded model file /home/dlinano/deepstream_sdk_v4.0.2_jetson/sources/apps/my_apps/2cams_4redes/=/home/dlinano/deepstream_sdk_v4.0.2_jetson/samples/models/Secondary_4clases/resnet18_detector2.etlt
0:00:01.246894844 10312   0x557b5d2470 ERROR                nvinfer gstnvinfer.cpp:511:gst_nvinfer_logger:<secondary_gie_0> NvDsInferContext[UID 2]:generateTRTModel(): Failed to create network using custom network creation function
0:00:01.246947187 10312   0x557b5d2470 ERROR                nvinfer gstnvinfer.cpp:511:gst_nvinfer_logger:<secondary_gie_0> NvDsInferContext[UID 2]:initialize(): Failed to create engine from model files
0:00:01.246998333 10312   0x557b5d2470 WARN                 nvinfer gstnvinfer.cpp:692:gst_nvinfer_start:<secondary_gie_0> error: Failed to create NvDsInferContext instance
0:00:01.247017500 10312   0x557b5d2470 WARN                 nvinfer gstnvinfer.cpp:692:gst_nvinfer_start:<secondary_gie_0> error: Config file path: /home/dlinano/deepstream_sdk_v4.0.2_jetson/sources/apps/my_apps/2cams_4redes/config_infer_4clases.txt, NvDsInfer Error: NVDSINFER_CUSTOM_LIB_FAILED
** ERROR: <main:651>: Failed to set pipeline to PAUSED
Quitting
ERROR from secondary_gie_0: Failed to create NvDsInferContext instance
Debug info: /dvs/git/dirty/git-master_linux/deepstream/sdk/src/gst-plugins/gst-nvinfer/gstnvinfer.cpp(692): gst_nvinfer_start (): /GstPipeline:pipeline/GstBin:secondary_gie_bin/GstNvInfer:secondary_gie_0:
Config file path: /home/dlinano/deepstream_sdk_v4.0.2_jetson/sources/apps/my_apps/2cams_4redes/config_infer_4clases.txt, NvDsInfer Error: NVDSINFER_CUSTOM_LIB_FAILED
App run failed

This is my configuration file for the app, I don’t know exactly what is going to be the path for the engine.

[application]
enable-perf-measurement=1
perf-measurement-interval-sec=5
#gie-kitti-output-dir=streamscl

[tiled-display]
enable=1
rows=2
columns=1
width=1280
height=720

[source0]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI 4=RTSP 5=CSI
type=1
camera-width=640
camera-height=480
camera-fps-n=30
camera-fps-d=1
camera-csi-sensor-id=0

[source1]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI
type=1
camera-width=640
camera-height=480
camera-fps-n=30
camera-fps-d=1
camera-v4l2-dev-node=1

[sink0]
enable=0
#Type - 1=FakeSink 2=EglSink 3=File 4=RTSPStreaming 5=Overlay
type=5
sync=1
display-id=0
offset-x=0
offset-y=0
width=0
height=0
overlay-id=1
source-id=0

[sink1]
enable=0
type=3
#1=mp4 2=mkv
container=1
#1=h264 2=h265 3=mpeg4
codec=1
sync=0
bitrate=2000000
output-file=out.mp4
source-id=0

[sink2]
enable=1
#Type - 1=FakeSink 2=EglSink 3=File 4=RTSPStreaming 5=Overlay
type=4
#1=h264 2=h265
codec=1
sync=0
bitrate=4000000
# set below properties in case of RTSPStreaming
rtsp-port=8554
udp-port=5400

[osd]
enable=1
border-width=2
text-size=15
text-color=1;1;1;1;
text-bg-color=0.3;0.3;0.3;1
font=Serif
show-clock=0
clock-x-offset=800
clock-y-offset=820
clock-text-size=12
clock-color=1;0;0;0

[streammux]
##Boolean property to inform muxer that sources are live
live-source=1
batch-size=2
##time out in usec, to wait after the first buffer is available
##to push the batch even if the complete batch is not formed
batched-push-timeout=40000
## Set muxer output width and height
width=1280
height=720

# config-file property is mandatory for any gie section.
# Other properties are optional and if set will override the properties set in
# the infer config file.
[primary-gie]
enable=1
gpu-id=0
model-engine-file=/home/dlinano/deepstream_sdk_v4.0.2_jetson/samples/models/Primary_Detector/resnet10.caffemodel_b2_fp16.engine
#Required to display the PGIE labels, should be added even when using config-file
#property
labelfile-path=/home/dlinano/deepstream_sdk_v4.0.2_jetson/samples/models/Primary_Detector/labels.txt
batch-size=2
#Required by the app for OSD, not a plugin property
bbox-border-color0=1;0;0;1
bbox-border-color1=0;1;1;1
bbox-border-color2=0;0;1;1
bbox-border-color3=0;1;0;1
interval=0
#Required by the app for SGIE, when used along with config-file property
gie-unique-id=1
nvbuf-memory-type=0
config-file=config_infer_primary.txt

[tracker]
enable=1
tracker-width=640
tracker-height=368
#ll-lib-file=/opt/nvidia/deepstream/deepstream-4.0/lib/libnvds_mot_iou.so
#ll-lib-file=/opt/nvidia/deepstream/deepstream-4.0/lib/libnvds_nvdcf.so
ll-lib-file=/opt/nvidia/deepstream/deepstream-4.0/lib/libnvds_mot_klt.so
#ll-config-file required for DCF/IOU only
#ll-config-file=tracker_config.yml
#ll-config-file=iou_config.txt
gpu-id=0
#enable-batch-process applicable to DCF only
enable-batch-process=1

[secondary-gie0]
enable=1
tlt-encoded-model==/home/dlinano/deepstream_sdk_v4.0.2_jetson/samples/models/Secondary_4clases/resnet18_detector.etlt
labelfile-path=/home/dlinano/deepstream_sdk_v4.0.2_jetson/samples/models/Secondary_4clases/labels.txt
batch-size=30
gpu-id=0
gie-unique-id=2
operate-on-gie-id=1
operate-on-class-ids=0;
config-file=config_infer_4clases.txt

[tests]
file-loop=0

And this is my configuration file for the network.

[property]
gpu-id=0
net-scale-factor=1.0
offsets=123.67;116.28;103.53
model-color-format=1
labelfile-path=/home/dlinano/deepstream_sdk_v4.0.2_jetson/samples/models/Secondary_4clases/labels.txt
tlt-encoded-model==/home/dlinano/deepstream_sdk_v4.0.2_jetson/samples/models/Secondary_4clases/resnet18_detector2.etlt

input-dims=3;224;224;0

uff-input-blob-name=input_1
output-blob-names=predictions/Softmax #output node name for classification
batch-size=30
# 0=FP32 and 1=INT8 mode
network-mode=0
process-mode=2
gpu-id=0
gie-unique-id=2
operate-on-gie-id=1
operate-on-class-ids=0
is-classifier=1
output-blob-names=predictions/Softmax
classifier-async-mode=1
classifier-threshold=0.3
gie-mode=2

Move this issue from DS forum into TLT forum.

Hi beatles_ben,
In your config file

tlt-encoded-model==/home/dlinano/deepstream_sdk_v4.0.2_jetson/samples/models/Secondary_4clases/resnet18_detector2.etlt

The “==” is not expected. Please try “=”

Also, there is no ngc key setting in your config file.