Ds-tao-detection -c pgie_dssd_tao_config.txt ..... report "terminate called after throwing an instance of 'YAML::BadFile'"

I am testing the Deepstream_Tao_apps (GitHub - NVIDIA-AI-IOT/deepstream_tao_apps: Sample apps to demonstrate how to deploy models trained with TAO on DeepStream), and as the guide, I ran the command:
./apps/tao_detection/ds-tao-detection -c configs/dssd_tao/pgie_dssd_tao_config.txt -i file:///$DS_SRC_PATH/samples/streams/sample_720p.mp4

and reported following error:
(tao) nvidia@ubuntu:~/WS/TAO/deepstream_tao_apps$ ./apps/tao_detection/ds-tao-detection -c configs/nvinfer/dssd_tao/pgie_dssd_tao_config.txt -i file:///$DS_SRC_PATH/samples/streams/sample_720p.mp4
Request sink_0 pad from streammux
terminate called after throwing an instance of ‘YAML::BadFile’
what(): bad file: -c
Aborted (core dumped)

And it is same using the
/apps/tao_detection/ds-tao-detection -c configs/nvinfer/dssd_tao/pgie_dssd_tao_config.yml -i file:///$DS_SRC_PATH/samples/streams/sample_720p.mp4

However, it runs successfully the following command:
./apps/tao_detection/ds-tao-detection configs/app/det_app_frcnn.yml (enable the config-file-path: …/nvinfer/dssd_tao/pgie_dssd_tao_config.yml)

What’s the problem? Bug in code?

Will move to Deepstream forum for tracking.

It’s a bug, will be fixed next version. It’s open source, you can fixed it or try this patch.

diff --git a/apps/tao_detection/deepstream_det_app.c b/apps/tao_detection/deepstream_det_app.c
index ce4e864..e8a13ee 100644
--- a/apps/tao_detection/deepstream_det_app.c
+++ b/apps/tao_detection/deepstream_det_app.c
@@ -484,6 +484,28 @@ det_bus_call (GstBus * bus, GstMessage * msg, gpointer data) {
     return TRUE;
 }
 
+static bool
+is_enc_hw_support() {
+  int current_device = -1;
+  cudaGetDevice(&current_device);
+  struct cudaDeviceProp prop;
+  cudaGetDeviceProperties(&prop, current_device);
+  bool enc_hw_support = TRUE;
+  if (prop.integrated) {
+    char device_name[50];
+    FILE* ptr = fopen("/proc/device-tree/model", "r");
+
+    if (ptr) {
+      while (fgets(device_name, 50, ptr) != NULL) {
+        if (strstr(device_name,"Orin") && (strstr(device_name,"Nano")))
+          enc_hw_support = FALSE;
+        }
+    }
+    fclose(ptr);
+  }
+  return enc_hw_support;
+}
+
 /* Check for parsing error. */
 #define RETURN_ON_PARSER_ERROR(parse_expr) \
   if (NVDS_YAML_PARSER_SUCCESS != parse_expr) { \
@@ -688,7 +710,7 @@ main (int argc, char *argv[]) {
 
     /* Finally render the osd output */
 
-    if(isYAML) {
+    if (isYAML) {
         GstElement *eglsink = gst_element_factory_make ("nveglglessink", "test-egl-sink");
         GstElement *filesink = gst_element_factory_make ("filesink", "test-file-sink");
         GstElement *fakesink = gst_element_factory_make("fakesink", "test-fake-sink");
@@ -709,14 +731,18 @@ main (int argc, char *argv[]) {
     }
 
     const char* use_display = std::getenv("USE_DISPLAY");
-    if(use_display != NULL && std::stoi(use_display) == 1) {
+    if (use_display != NULL && std::stoi(use_display) == 1) {
         useDisplay = true;
     }
 
-    if(useDisplay == FALSE) {
+    if (useDisplay == FALSE) {
         if(isImage == FALSE){
             parser1 = gst_element_factory_make ("h264parse", "h264-parser1");
-            parse_filesink_yaml(&enc_type, argv[1]);
+            if (isYAML) {
+              parse_filesink_yaml(&enc_type, argv[1]);
+            } else {
+              enc_type = is_enc_hw_support();
+            }
             if(enc_type == 0){
               enc = gst_element_factory_make ("nvv4l2h264enc", "h264-enc");
             } else {
@@ -755,7 +781,7 @@ main (int argc, char *argv[]) {
             sink = gst_element_factory_make("nv3dsink", "nv3d-sink");
         else
 #ifdef __aarch64__
-	    sink = gst_element_factory_make("nv3dsink", "nv3d-sink");
+            sink = gst_element_factory_make("nv3dsink", "nv3d-sink");
 #else
             sink = gst_element_factory_make ("nveglglessink", "nvvideo-renderer");
 #endif

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.