I am using a densenet161 trt model with fp16 format. When I run that model outside the deepstream with the trtmodel, I was able to get the same accuracy as like fp32. But when I place in inside the deepstream the scores are difference. How to understand whats going on ?
I am suspecting that difference is happening at the preprocessing step, but not sure.
python version:
self.mean, self.std = [0.485, 0.456, 0.406], [0.229, 0.224, 0.225]
self.trans = transforms.Compose(
[
transforms.Resize((224, 224)),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
]
)
Deepstream version:
gpu-id=0
model-engine-file=…/ds_models/stable/densenet161_4x3x224x224_ls_fp16.trt
batch-size=4
net-scale-factor=0.01735207357
scaling-filter=1
offsets=123.675;116.28;103.53
force-implicit-batch-dim=1
model-color-format=0
network-mode=2
process-mode=2
network-type=100
output-tensor-meta=1
gie-unique-id=3
operate-on-gie-id=1
operate-on-class-ids=0
interval=0
output-blob-names=score
To get the scores in deepstream,
if user_meta and user_meta.base_meta.meta_type == pyds.NvDsMetaType.NVDSINFER_TENSOR_OUTPUT_META:
try:
tensor_meta = pyds.NvDsInferTensorMeta.cast(user_meta.user_meta_data)
except StopIteration:
break
# Check if we took the correct GIE-UNIQUE-ID
if tensor_meta.unique_id != self.UNIQUE_ID:
try:
l_user = l_user.next
except StopIteration:
break
continue
layer = pyds.get_nvds_LayerInfo(tensor_meta, 0)
score = pyds.get_detections(layer.buffer, 0)
Questions:
- Is the net-scale-factor and the offsets correct compared with mean and std?
- How can I debug to check where the issue is happening with the deepstream version?
- How to access the input of the model (before and after preprocessing step)?
Please let me know how I can fix this issue.
Thank you,
Please provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU) Jetson
• DeepStream Version 6.2
• JetPack Version (valid for Jetson only) 5.1.2
• TensorRT Version 8.5.2
• Issue Type( questions, new requirements, bugs) bug
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)