SSD Mobilenet onnx from saved_model trained in tensorflow api

Hi,

I have 17k labeled images, and i trained them in tensorflow 2 object detection api. and the model was very successful (96% detection rate), and uses 3.5gb ram. I had to convert it trt or onnx in order to run on jetson nano.
But i can not convert this model to onnx or trt in order to run in jetson nano with low ram, high fps.

  • How can I manage this conversation and run the model on jetson nano? I’m searching it nearly 3 months and i cannot find any solution. I tried many tutorials and codes. Looked lots of github pages, but I cannot. If you have a good tutorial or knowledge please share with me.

Then, I tried to jetson inference tutorials, and trained ssd-mb1 in pytorch by using train_ssd.py code in jetson inference. I trained the model in my computer nearly 500 epochs
(100 epoch 0.01 lr, then 100 epoch 0.001, then 40 epoch 0.1 lr, then i selected the best in 40 epochs and train it 150 epoch 0.01 lr, finally 100 epoch 0.001lr)
But detection rate of the best models among the 500 .pth file is only 76%.
and it cannot detect any object if object is far.

  • How can i improve and make this model good as tensorflow?

Thanks,

sorry to keep busy with simple problems @dusty_nv bu i need

Hi,

1.
The original model takes 3.5 GB memory, which is too large to deploy on the Nano.
But if you can convert it into an ONNX model (ex. tf2onnx), some experiments are worth trying.

First, you can convert it into a TensorRT engine using trtexec without setting swap memory.
Since the required memory might over the Nano’s limit, you can do this experiment on the desktop directly.

Usually, TensorRT uses less memory than object detection API since it only deploys the inference node.
Try to measure the memory, and please also share this information with us.

After that, please try to deploy the model with FP16 and INT8 mode.
Typically, lower precision will save memory usage but might have some impact on accuracy.

2.
Suppose you are also using the ssd-related model in the object detection API.
So maybe you can apply a similar hyperparameter to see if it helps first.

Thanks.

1 Like