Argument "--gen_ds_config" does not work while exporting Detectnet V2 model

Please provide the following information when requesting support.

• Network Type (Detectnet_v2/)
• TLT Version (3.0)

I trained a custom Detectnet model on TlT version 3.0. While eporting the tlt file to the etlt format I passed the --gen_ds_config as I need the deepstream labels and config files. However, TLT does not recognize the argument. The command I’m trying to run in the Jupyter notebook:

!mkdir -p $LOCAL_EXPERIMENT_DIR/experiment_dir_final
# Removing a pre-existing copy of the etlt if there has been any.
import os
output_file=os.path.join(os.environ['LOCAL_EXPERIMENT_DIR'],
                         "experiment_dir_final/resnet18_detector.etlt")
if os.path.exists(output_file):
    os.system("rm {}".format(output_file))
!tlt detectnet_v2 export \
                  -m $USER_EXPERIMENT_DIR/experiment_dir_unpruned/weights/resnet18_detector.tlt \
                  -o $USER_EXPERIMENT_DIR/experiment_dir_final/resnet18_detector.etlt \
                  -k $KEY \
                  --gen_ds_config

The error I get:

Matplotlib created a temporary config/cache directory at /tmp/matplotlib-3k65viqr because the default path (/.config/matplotlib) is not a writable directory; it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib and to better support multiprocessing.
Using TensorFlow backend.
usage: detectnet_v2 [-h] [--gpus GPUS] [--gpu_index GPU_INDEX [GPU_INDEX ...]]
                    [--use_amp] [--log_file LOG_FILE]
                    {calibration_tensorfile,dataset_convert,evaluate,export,inference,prune,train}
                    ...
detectnet_v2: error: unrecognized arguments: --gen_ds_config
2021-07-14 11:22:13,414 [INFO] tlt.components.docker_handler.docker_handler: Stopping container.

Please note that if I do NOT pass the --gen_ds_config then the exports command works. Please advise as to how to fix this.

Can you run below command to check the tlt version?
$ tlt info --verbose

And also can you run following command and paste the result?
$ tlt detectnet_v2 export

On my side, I can run well with “–gen_ds_config”

$ tlt detectnet_v2 export -m /workspace/demo_2.0/peoplenet_retrain/resnet34_peoplenet.tlt -o /workspace/demo_2.0/peoplenet_retrain/resnet34_peoplenet_new.etlt -k tlt_encode --gen_ds_config -e /workspace/demo_2.0/peoplenet_retrain/detectnet_v2_train_resnet34_kitti.txt
2021-07-14 15:21:48,932 [INFO] root: Registry: [‘nvcr.io’]
2021-07-14 15:21:52,639 [WARNING] tlt.components.docker_handler.docker_handler:
Docker will run the commands as root. If you would like to retain your
local host permissions, please add the “user”:“UID:GID” in the
DockerOptions portion of the ~/.tlt_mounts.json file. You can obtain your
users UID and GID by using the “id -u” and “id -g” commands on the
terminal.
Using TensorFlow backend.
Using TensorFlow backend.
WARNING:tensorflow:Deprecation warnings have been disabled. Set TF_ENABLE_DEPRECATION_WARNINGS=1 to re-enable them.
2021-07-14 07:22:00,415 [INFO] iva.detectnet_v2.spec_handler.spec_loader: Merging specification from /workspace/demo_2.0/peoplenet_retrain/detectnet_v2_train_resnet34_kitti.txt
2021-07-14 07:22:05,056 [INFO] iva.common.export.keras_exporter: Using input nodes: [‘input_1’]
2021-07-14 07:22:05,056 [INFO] iva.common.export.keras_exporter: Using output nodes: [‘output_cov/Sigmoid’, ‘output_bbox/BiasAdd’]
/usr/local/lib/python3.6/dist-packages/keras/engine/saving.py:292: UserWarning: No training configuration found in save file: the model was not compiled. Compile it manually.
warnings.warn('No training configuration found in save file: ’
NOTE: UFF has been tested with TensorFlow 1.14.0.
WARNING: The version of TensorFlow installed on this system is not guaranteed to work with UFF.
2021-07-14 07:22:22,750 [INFO] modulus.export._uff: Modulus patch identity layer in padding inputs.
2021-07-14 07:22:23,045 [INFO] modulus.export._uff: Modulus patch identity layer in padding inputs.
DEBUG [/usr/local/lib/python3.6/dist-packages/uff/converters/tensorflow/converter.py:96] Marking [‘output_cov/Sigmoid’, ‘output_bbox/BiasAdd’] as outputs
2021-07-14 15:23:08,122 [INFO] tlt.components.docker_handler.docker_handler: Stopping container.

Hi Morganh,

Here’s the output of tlt info:

(nvidia) vast@remote-subhankar:~/tlt$  tlt info --verbose                                                                                           [22/202]Configuration of the TLT Instance                                                                                                                                                                                                                                                                                       dockers:                                                                                                                                                            nvcr.io/nvidia/tlt-streamanalytics:                                                                                                                                 docker_tag: v3.0-dp-py3                                                                                                                                     tasks:                                                                                                                                                              1. augment                                                                                                                                                  2. classification                                                                                                                                           3. detectnet_v2                                                                                                                                             4. dssd                                                                                                                                                     5. emotionnet                                                                                                                                               6. faster_rcnn                                                                                                                                              7. fpenet                                                                                                                                                   8. gazenet                                                                                                                                                  9. gesturenet                                                                                                                                               10. heartratenet                                                                                                                                            11. lprnet                                                                                                                                                  12. mask_rcnn                                                                                                                                               13. retinanet                                                                                                                                               14. ssd                                                                                                                                                     15. unet                                                                                                                                                    16. yolo_v3                                                                                                                                                 17. yolo_v4
                        18. tlt-converter
        nvcr.io/nvidia/tlt-pytorch:
                docker_tag: v3.0-dp-py3
                tasks:
                        1. speech_to_text
                        2. text_classification
                        3. question_answering
                        4. token_classification
                        5. intent_slot_classification
                        6. punctuation_and_capitalization
format_version: 1.0
tlt_version: 3.0
published_date: 02/02/2021

And here’s the output of tlt detectnet_v2 export:

(nvidia) vast@remote-subhankar:~/tlt$  tlt detectnet_v2 export
Matplotlib created a temporary config/cache directory at /tmp/matplotlib-ijwgyuvy because the default path (/.config/matplotlib) is not a writable directory; it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib and to better support multiprocessing.
Using TensorFlow backend.
usage: detectnet_v2 export [-h] [--gpus GPUS]
                           [--gpu_index GPU_INDEX [GPU_INDEX ...]] [--use_amp]
                           [--log_file LOG_FILE] -m MODEL -k KEY
                           [-o OUTPUT_FILE] [--force_ptq]
                           [--cal_data_file CAL_DATA_FILE]
                           [--cal_image_dir CAL_IMAGE_DIR]
                           [--data_type {fp32,fp16,int8}] [-s]
                           [--cal_cache_file CAL_CACHE_FILE]
                           [--batches BATCHES]
                           [--max_workspace_size MAX_WORKSPACE_SIZE]
                           [--max_batch_size MAX_BATCH_SIZE]
                           [--batch_size BATCH_SIZE] [-e EXPERIMENT_SPEC]
                           [--engine_file ENGINE_FILE] [-v]
                           {calibration_tensorfile,dataset_convert,evaluate,export,inference,prune,train}
                           ...
detectnet_v2 export: error: the following arguments are required: -m/--model, -k/--key
2021-07-14 13:05:10,179 [INFO] tlt.components.docker_handler.docker_handler: Stopping container.

Please upgrade tlt version from 3.0-dp-py3 to 3.0-py3.

See NVIDIA TAO Documentation
$ pip3 install --upgrade nvidia-tlt

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