Color channel error in deepstream test app 2

Hi,
I am using this repo to run facenet with deepstream in sgie config. I successfully built a .plan file but when I am running it. I am getting the following error

I used this notebook for model conversion

Creating Pipeline

Creating Source

Creating H264Parser

Creating Decoder

Creating EGLSink

Playing file file:///opt/nvidia/deepstream/deepstream-5.0/samples/streams/sample_qHD.h264
Adding elements to Pipeline

Linking elements in the Pipeline

Starting pipeline

Using winsys: x11
Opening in BLOCKING MODE
0:00:17.618038327 23627 0x147fbf00 INFO nvinfer gstnvinfer.cpp:619:gst_nvinfer_logger: NvDsInferContext[UID 2]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1701> [UID = 2]: deserialized trt engine from :/opt/nvidia/deepstream/deepstream-5.0/sources/deepstream_python_apps/apps/deepstream-facenet/models/facenet_engine.plan
INFO: [Implicit Engine Info]: layers num: 2
**0 INPUT kFLOAT input_1:0 160x160x3 **
1 OUTPUT kFLOAT Bottleneck_BatchNorm/batchnorm_1/add_1:0 128

0:00:17.618382285 23627 0x147fbf00 INFO nvinfer gstnvinfer.cpp:619:gst_nvinfer_logger: NvDsInferContext[UID 2]: Info from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:1805> [UID = 2]: Use deserialized engine model: /opt/nvidia/deepstream/deepstream-5.0/sources/deepstream_python_apps/apps/deepstream-facenet/models/facenet_engine.plan
0:00:17.618425931 23627 0x147fbf00 ERROR nvinfer gstnvinfer.cpp:613:gst_nvinfer_logger: NvDsInferContext[UID 2]: Error in NvDsInferContextImpl::preparePreprocess() <nvdsinfer_context_impl.cpp:874> [UID = 2]: RGB/BGR input format specified but network input channels is not 3
ERROR: Infer Context prepare preprocessing resource failed., nvinfer error:NVDSINFER_CONFIG_FAILED
0:00:17.690020358 23627 0x147fbf00 WARN nvinfer gstnvinfer.cpp:809:gst_nvinfer_start: error: Failed to create NvDsInferContext instance
0:00:17.690159525 23627 0x147fbf00 WARN nvinfer gstnvinfer.cpp:809:gst_nvinfer_start: error: Config file path: dstest2_sgie1_config.txt, NvDsInfer Error: NVDSINFER_CONFIG_FAILED
Error: gst-resource-error-quark: Failed to create NvDsInferContext instance (1): /dvs/git/dirty/git-master_linux/deepstream/sdk/src/gst-plugins/gst-nvinfer/gstnvinfer.cpp(809): gst_nvinfer_start (): /GstPipeline:pipeline0/GstNvInfer:secondary1-nvinference-engine:
Config file path: dstest2_sgie1_config.txt, NvDsInfer Error: NVDSINFER_CONFIG_FAILED

I can also attach the .plan file for reference or to reproduce the issue. i am using jetson nano jetpack 4.4

can someone please address this issue? @Fiona.Chen , @AastaLLL , @DaneLLL

Hi,

Since primary nvinfer is essential component for the Deepstream pipeline with TensorRT.
Would you mind to run the facenet in pgie first?

Thanks.

I did and faced the same issue

Hi,

Thanks for the feedback.

Could you share the resource for reproducing this issue with us?
Including the facenet model and the change you applied to the repository.

Thanks.

I solved the problem by using the following command.
python3 -m tf2onnx.convert --input ./facenet_freezed.pb --inputs input_1:0[1,160,160,3] --inputs-as-nchw input_1:0 --outputs Bottleneck_BatchNorm/batchnorm_1/add_1:0 --output facenet.onnx