Training results are not good for Peoplenet pretrained model

Please provide the following information when requesting support.

• Hardware (T4/V100/Xavier/Nano/etc)RTX4080
• Network Type (Detectnet_v2/Faster_rcnn/Yolo_v4/LPRnet/Mask_rcnn/Classification/etc)PeopleNet
• TLT Version (Please run “tlt info --verbose” and share “docker_tag” here)
• Training spec file(If have, please share here)
detectnet_v2_train_resnet34_kitti.txt (4.8 KB)

I tried to retrain PeopleNet pretrained model (trainable_unencrypted_v2.6) with my dataset.

The dataset was used to train yolov4 using Tao. The accuracy is good.

Tried again with Peoplenet pretrained model. But accuracy is bad. What did I do wrong?

The training results is bad as follows.

Epoch 120/120

Validation cost: 0.000462
Mean average_precision (in %): 0.1050

±-----------±-------------------------+
| class name | average precision (in %) |
±-----------±-------------------------+
| lie | 0.0 |
| stand | 0.2100491957326848 |
±-----------±-------------------------+

But it was quite good training with yolov4. All above 99%.

I am using tao docker in training. (nvcr.io/nvidia/tao/tao-toolkit 5.0.0-tf1.15.5).

The followings are the commands used in training.

detectnet_v2 dataset_convert -d /workspace/home/user/tao_tutorials/notebooks/tao_launcher_starter_kit/detectnet_v2/specs/detectnet_v2_tfrecords_kitti_trainval.txt -o /workspace/mnt/sda/Activities/BMTC_V/Stand_lie/tfrecords_peoplenet/train
detectnet_v2 train -e /workspace/home/user/tao_tutorials/notebooks/tao_launcher_starter_kit/detectnet_v2/specs/detectnet_v2_train_resnet34_kitti.txt -r /workspace/home/user/tao_tutorials/bmtc/Stand_lie/experiment_dir_unpruned_peoplent -k tlt_encode --gpus 2

How about the resolution of your dataset? Are they various or fixed size?
Please add “enable_auto_resize: true” in the config file.

    output_image_width: 960
    output_image_height: 544
    enable_auto_resize: true

More, could you please pull nvcr.io/nvidia/tao/tao-toolkit:4.0.1-tf1.15.5 docker for training again? There is regression issue for detectnet_v2 in 5.0.1 docker.
$ docker pull nvcr.io/nvidia/tao/tao-toolkit:4.0.1-tf1.15.5
Then inside the docker, run training as below.
$ docker run --runtime=nvidia -it --rm -d --name 4.0.1-docker -v /localhome/morganh:/localhome/morganh nvcr.io/nvidia/tao/tao-toolkit:4.0.1-tf1.15.5 /bin/bash
$ docker exec -it 4.0.1-docker /bin/bash

All are fixed to 1920x1080.
Ok I’ll try.

BTW, for 4.0.1 docker, you may need to use the encrypted pretrained model https://catalog.ngc.nvidia.com/orgs/nvidia/teams/tao/models/peoplenet/files?version=trainable_v2.6.

The results are still the same using 4.0.1 docker.

The same dataset trained using Yolov4 has good accuracy. Why training peoplenet with detectnet_v2 has bad results?

Validation cost: 0.000526
Mean average_precision (in %): 0.0442
class name      average precision (in %)

lie                            0
stand                          0.0883139

The procedure what I did are.

(1)Do kitty format conversion using the code below. Because all my labeling are in Json.

This is Python code. I just changed extension to .txt so that i can upload here.

ConvertJson_Kitty.txt (1.0 KB)

(2)All are converted to tfrecords.

detectnet_v2 dataset_convert -d /workspace/home/user/tao_tutorials/notebooks/tao_launcher_starter_kit/detectnet_v2/specs/detectnet_v2_tfrecords_kitti_trainval.txt -o /workspace/mnt/sda/Activities/BMTC_V/Stand_lie/tfrecords_peoplenet/train

(3)Then training.

detectnet_v2 train -e /workspace/home/user/tao_tutorials/notebooks/tao_launcher_starter_kit/detectnet_v2/specs/detectnet_v2_train_resnet34_kitti.txt -r /workspace/home/user/tao_tutorials/bmtc/Stand_lie/experiment_dir_unpruned_peoplent -k tlt_encode --gpus 2

Spec files are here.

This training log.

Could you set enable_auto_resize: true as mentioned above?

all my images are fixed size 1920x1080. but let me try.

Increased. But not that much.

Validation cost: 0.005741
Mean average_precision (in %): 5.1656

class name average precision (in %)


lie 0.903239
stand 9.42804

it is trained with enable_auto_resize: true

Even though the training results are not good, I tried to convert to .engine.

I can successfully convert to onnx.

This is log in exporting to onnx.

Using TensorFlow backend.
2025-09-05 00:08:22.962699: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0
WARNING:tensorflow:Deprecation warnings have been disabled. Set TF_ENABLE_DEPRECATION_WARNINGS=1 to re-enable them.
/usr/local/lib/python3.6/dist-packages/requests/init.py:91: RequestsDependencyWarning: urllib3 (1.26.5) or chardet (3.0.4) doesn’t match a supported version!
RequestsDependencyWarning)
Using TensorFlow backend.
WARNING:tensorflow:Deprecation warnings have been disabled. Set TF_ENABLE_DEPRECATION_WARNINGS=1 to re-enable them.
/usr/local/lib/python3.6/dist-packages/requests/init.py:91: RequestsDependencyWarning: urllib3 (1.26.5) or chardet (3.0.4) doesn’t match a supported version!
RequestsDependencyWarning)
2025-09-05 00:08:26,035 [INFO] iva.detectnet_v2.spec_handler.spec_loader: Merging specification from /workspace/home/user/tao_tutorials/notebooks/tao_launcher_starter_kit/detectnet_v2/specs/detectnet_v2_train_resnet34_kitti.txt
2025-09-05 00:08:27,389 [INFO] iva.common.export.keras_exporter: Using input nodes: [‘input_1’]
2025-09-05 00:08:27,389 [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.
DEBUG [/usr/local/lib/python3.6/dist-packages/uff/converters/tensorflow/converter.py:96] Marking [‘output_cov/Sigmoid’, ‘output_bbox/BiasAdd’] as outputs
Telemetry data couldn’t be sent, but the command ran successfully.
[WARNING]: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)>
Execution status: PASS

Then convert to engine using nvcr.io/nvidia/tao/tao-toolkit:5.5.0-deploy docker.

It was not successful with the following issue.

root@user-Nuvo-10000-Series:/workspace/home/user/tao_tutorials/bmtc/Stand_lie# detectnet_v2 gen_trt_engine -m /workspace/home/user/tao_tutorials/bmtc/Stand_lie/experiment_dir_unpruned_peoplent/weights/peoplenet_model.onnx -e /workspace/home/user/tao_tutorials/notebooks/tao_launcher_starter_kit/detectnet_v2/specs/detectnet_v2_train_resnet34_kitti.txt --cal_image_dir /workspace/home/user/tao_tutorials/bmtc/Stand_lie/train/images --data_type int8 --batch_size 16 --min_batch_size 1 --opt_batch_size 8 --max_batch_size 16 --batches 10 --cal_cache_file /workspace/home/user/tao_tutorials/bmtc/Stand_lie/experiment_dir_unpruned_peoplent/weights/cal.bin --cal_data_file /workspace/home/user/tao_tutorials/bmtc/Stand_lie/experiment_dir_unpruned_peoplent/weights/cal.tensorfile --engine_file /workspace/home/user/tao_tutorials/bmtc/Stand_lie/experiment_dir_unpruned_peoplent/weights/peoplenet_model.engine --results_dir /workspace/home/user/tao_tutorials/bmtc/Stand_lie/experiment_dir_unpruned_peoplent/weights
Loading uff directly from the package source code
Loading uff directly from the package source code
2025-09-05 00:32:01,806 [TAO Toolkit] [INFO] nvidia_tao_deploy.cv.common.logging.status_logging 196: Log file already exists at /workspace/mnt/sda/Activities/BMTC_V/Stand_lie/experiment_dir_unpruned_peoplent/weights/status.json
2025-09-05 00:32:01,806 [TAO Toolkit] [INFO] root 167: Starting detectnet_v2 gen_trt_engine.
[09/05/2025-00:32:01] [TRT] [I] [MemUsageChange] Init CUDA: CPU +1, GPU +0, now: CPU 36, GPU 880 (MiB)
[09/05/2025-00:32:05] [TRT] [I] [MemUsageChange] Init builder kernel library: CPU +1453, GPU +268, now: CPU 1566, GPU 1148 (MiB)
2025-09-05 00:32:05,038 [TAO Toolkit] [INFO] nvidia_tao_deploy.cv.detectnet_v2.engine_builder 143: Parsing ONNX model
2025-09-05 00:32:05,060 [TAO Toolkit] [INFO] root 167: Error parsing message with type ‘onnx.ModelProto’
Traceback (most recent call last):
File “/usr/local/lib/python3.10/dist-packages/nvidia_tao_deploy/cv/detectnet_v2/scripts/gen_trt_engine.py”, line 217, in
main(args)
File “/usr/local/lib/python3.10/dist-packages/nvidia_tao_deploy/cv/common/decorators.py”, line 63, in _func
raise e
File “/usr/local/lib/python3.10/dist-packages/nvidia_tao_deploy/cv/common/decorators.py”, line 47, in _func
runner(cfg, **kwargs)
File “/usr/local/lib/python3.10/dist-packages/nvidia_tao_deploy/cv/detectnet_v2/scripts/gen_trt_engine.py”, line 72, in main
builder.create_network(tmp_onnx_file, file_format)
File “/usr/local/lib/python3.10/dist-packages/nvidia_tao_deploy/cv/detectnet_v2/engine_builder.py”, line 144, in create_network
self._input_dims = self.get_onnx_input_dims(model_path)
File “/usr/local/lib/python3.10/dist-packages/nvidia_tao_deploy/cv/detectnet_v2/engine_builder.py”, line 96, in get_onnx_input_dims
onnx_model = onnx.load(model_path)
File “/usr/local/lib/python3.10/dist-packages/onnx/init.py”, line 210, in load_model
model = _get_serializer(format, f).deserialize_proto(_load_bytes(f), ModelProto())
File “/usr/local/lib/python3.10/dist-packages/onnx/serialization.py”, line 118, in deserialize_proto
decoded = typing.cast(Optional[int], proto.ParseFromString(serialized))
google.protobuf.message.DecodeError: Error parsing message with type ‘onnx.ModelProto’
[2025-09-05 00:32:05,298 - TAO Toolkit - nvidia_tao_deploy.cv.common.entrypoint.entrypoint_proto - INFO] Sending telemetry data.
[2025-09-05 00:32:05,298 - TAO Toolkit - root - INFO] ================> Start Reporting Telemetry <================
[2025-09-05 00:32:05,298 - TAO Toolkit - root - INFO] Sending {‘version’: ‘5.5.0’, ‘action’: ‘gen_trt_engine’, ‘network’: ‘detectnet_v2’, ‘gpu’: [‘NVIDIA-GeForce-RTX-4080-SUPER’], ‘success’: False, ‘time_lapsed’: 3.870880603790283} to ``https://api.tao.ngc.nvidia.com``.
[2025-09-05 00:32:07,702 - TAO Toolkit - root - INFO] Telemetry sent successfully.
[2025-09-05 00:32:07,702 - TAO Toolkit - root - INFO] ================> End Reporting Telemetry <================
[2025-09-05 00:32:07,702 - TAO Toolkit - nvidia_tao_deploy.cv.common.entrypoint.entrypoint_proto - INFO] Execution status: FAIL
root@user-Nuvo-10000-Series:/workspace/home/user/tao_tutorials/bmtc/Stand_lie# exit
exit

The AP is still low. Can you double check your label? Is the bbox’s groudtruth correct?
Is it possible to share one example image along with its label file?

Please check if you can use Netron to open this onnx file successfully.

Lables are ok. The box from label file is plotted.

false_alarm2.txt (70 Bytes)

This is label file.

I’m going to retrain in Yolov4. If ok, then dataset is fine.

I open this label file. It is:
stand 0.00 0 0.00 383 229 262 529 0.00 0.00 0.00 0.00 0.00 0.00 0.00

But from above 1920x1080 image, the top left corner should be about (260, 232), the bottom right should be about (380,534).
So, the label should be
stand 0.00 0 0.00 260 232 380 534 0.00 0.00 0.00 0.00 0.00 0.00 0.00

Seems that the label is not correct. Could you double check?

Now I draw boxes on all images and check boxes on the image. All are ok.

false_alarm2.txt (70 Bytes)

box coordinates are arranged as xmin, ymin, xmax. ymax in the label file, right?

Now I am retraining.

Yes, please refer to Data Annotation Format — Tao Toolkit

Is it like this?

0,0 is top left corner, right?

So (xmin, ymin) is top left corner and (xmax, ymax) is bottom right of the box?

Why the image is changed?

I mean your previous label is not expected. For example,
stand 0.00 0 0.00 383 229 262 529 0.00 0.00 0.00 0.00 0.00 0.00 0.00
It does not follow the order of xmin, ymin, xmax, ymax

Please set to correct order for the label.
Image is not needed to change.

For this image, the label is

stand 0.00 0 0.00 263 223 382 531 0.00 0.00 0.00 0.00 0.00 0.00 0.00

Yes, you have modified the labels now. That is correct.
But the image is not needed to change.