How do I use Peoplenet with yolo_v4?

,

Hi.

I am looking to use the TAO toolkit 5.1.0 to perform transfer learning on yolo_v4.
I want to use peoplenet which I can get from NGC as a pretrained model, but I get an error.

I have confirmed that the conv1 bias that was present in peoplenet is not present in the generic pre-trained model, but is peoplenet not available for yolo_v4?
Or is there some place that needs further configuration?

Thanks.


INFO: conv1 has incorrect shape in pretrained model.
Traceback (most recent call last):
File “/usr/local/lib/python3.8/dist-packages/nvidia_tao_tf1/cv/yolo_v4/builders/model_builder.py”, line 37, in _load_pretrain_weights
layer.set_weights(l_return.get_weights())
File “/usr/local/lib/python3.8/dist-packages/keras/engine/base_layer.py”, line 1040, in set_weights
raise ValueError(‘You called set_weights(weights) on layer "’ +
ValueError: You called set_weights(weights) on layer “conv1” with a weight list of length 2, but the layer was expecting 1 weights. Provided weights: [array([[[[ 5.57525218e-01, -2.58280605e-01, -1.58…

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.8/dist-packages/nvidia_tao_tf1/cv/yolo_v4/scripts/train.py”, line 165, in
main()
File “/usr/local/lib/python3.8/dist-packages/nvidia_tao_tf1/cv/common/utils.py”, line 717, in return_func
raise e
File “/usr/local/lib/python3.8/dist-packages/nvidia_tao_tf1/cv/common/utils.py”, line 705, in return_func
return func(*args, **kwargs)
File “/usr/local/lib/python3.8/dist-packages/nvidia_tao_tf1/cv/yolo_v4/scripts/train.py”, line 161, in main
raise e
File “/usr/local/lib/python3.8/dist-packages/nvidia_tao_tf1/cv/yolo_v4/scripts/train.py”, line 143, in main
run_experiment(
File “/usr/local/lib/python3.8/dist-packages/nvidia_tao_tf1/cv/yolo_v4/scripts/train.py”, line 84, in run_experiment
model = build_training_pipeline(
File “/usr/local/lib/python3.8/dist-packages/nvidia_tao_tf1/cv/yolo_v4/models/utils.py”, line 74, in build_training_pipeline
yolov4.build_training_model(hvd)
File “/usr/local/lib/python3.8/dist-packages/nvidia_tao_tf1/cv/yolo_v4/models/yolov4_model.py”, line 480, in build_training_model
self.load_pretrained_model(
File “/usr/local/lib/python3.8/dist-packages/nvidia_tao_tf1/cv/yolo_v4/models/yolov4_model.py”, line 313, in load_pretrained_model
_load_pretrain_weights(pretrained_model, self.keras_model)
File “/usr/local/lib/python3.8/dist-packages/nvidia_tao_tf1/cv/yolo_v4/builders/model_builder.py”, line 40, in _load_pretrain_weights
raise ValueError(layer.name + ’ has incorrect shape in pretrained model.')
ValueError: conv1 has incorrect shape in pretrained model.
Execution status: FAIL
2024-01-11 10:42:29,313 [TAO Toolkit] [INFO] nvidia_tao_cli.components.docker_handler.docker_handler 337: Stopping container.

Hi,
Currently there are 3 kinds of peoplenet pretrained models in ngc.
See GPU-optimized AI, Machine Learning, & HPC Software | NVIDIA NGC.

  • For detectnet_v2
  • For D-DETR
  • For DINO

There is not available peoplenet pretrained model for YOLO_v4.
Please use above 3 networks instead to try. Thanks.

You can use below pretrained model from ngc to train YOLO_v4.
TAO Pretrained Object Detection | NVIDIA NGC.

1 Like

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