It is OK to use ONNX model. Please make sure you have give the correct gst-nvinfer configurations in the nvinfer config file.
https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_plugin_gst-nvinfer.html
DeepStream SDK FAQ - Intelligent Video Analytics / DeepStream SDK - NVIDIA Developer Forums