I wrote a series of blog posts which form a complete tutorial on how to train an object detector with custom data and how to optimize the model with TF-TRT (TensorRT), and then to deploy it onto Jetson TX2. More specifically, I shared the complete code for training a hand detector and for deploying the trained tensorflow model on JTX2. In the end, I demonstrated ~24 fps real-time hand detection with a live camera feed.
I really tried my best to make the code simple and working well. If you find any issues or have any suggestions, feel free to leave a comment on my blog posts. Otherwise, if you find the posts helpful, I’d also appreciate you to comment and let me know.
Wonderful, thank you :). Also, I trained my own model from scratch. Is there a way to convert that to tensorRT, or must I start with one of the pre-trained networks and build on top of it?
If you’re using tensorflow object detection API, then my modified “tf_trt_models” code would likely just work. Just add pointers to the config file and trained model directory. Reference:
If you have a frozen graph saved as a pb file, you could just load the pb file as a graph and call trt.create_inference_graph() to get the TensorRT optimized graph.
As to tensorflow version, I’ve mostly been using 1.12.2 (or 1.12.0). I recommend using protobuf-3.6.1 along with tensorflow-1.12.x. For details, please refer to my blog posts.
Hi jkjung13!
Thanks for your explanation,I havve solved my problem,the problem lies in the “numClasses=21,” and “inputOrder=[0, 2, 1],” firstly the inputOrder=[0, 1, 2] should correctly according to the NMS part in the .pbtxt file,secondly,the numClasses should added 1 to the detecte class number,for example:your detecte class number is 20,you should added 1 for the background.
Hope this is helpful for ones who encountered the same problem as me!!!