Attributes specified for class 1 while element has been configured with num-detected-classes=1

I am trying to perform inference with a single object detection model using detectnet_v2. In the config file I have given

num-detected-classes=1

In the labels.txt, I have mentioned only one class name.
But when run the application I am getting below error:

Attributes specified for class 1 while element has been configured with num-detected-classes=1

If I give

num-detected-classes=2

I can able to run the deepstream but its not showing any bounding boxes.

• Hardware Platform (GPU)
• DeepStream Version 5.0.1 container
**• TensorRT Version **
• NVIDIA GPU Driver Version (440.100)
• Issue Type( questions)

Did you use original detectnet_v2 model? or your trained model?

I used the original model to finetune for my data.

Try with original label file, and set num-detected-classes to 3

The original label file has three names, and I trained for only one class. Actually I followed face-mask-detection repo to perform transfer learning.
According to that the label.txt contains: mask, no-mask, default
And config files contains no_detected_classes = 2.

Then I tried with
label.txt data to- object1, default
config file : no_detected_classes = 1

and
label.txt data to- object1
config file : no_detected_classes = 1
and
label.txt data to- object1, default
config file : no_detected_classes = 2

Nothing worked.

Can you run with tlt first to make sure the model is correct?

Yes. I tried with both models. I got the same results.
And I also made another mistake, the training image size is not multiples of 16. According to the detectnet_v2 documentation it is supposed to be multiples of 16. I made those changes and currently training the model.
I will post the status once I complete the training.

OK, pls create topic in TLT forum if you are running into issues related to trainning models.