Unfortunately I didn’t keep my hacky code to make TF’s CenterNet run on Jetson, since I decided to stick to Mobilenetv2 SSD instead.
Regarding the GatherND problem, perhaps you will find this helpful:
One thing I noticed was that the TF centernet model used to have Gather nodes instead of GatherND, until this commit . So you could try going before that commit.
The other thing is to try seeing what GatherND does and change it to Gather. I think that if you have a batch size of 1 (which was enough for my use case), then it is not difficult. Try to understand what GatherND is doing, maybe google for Gather vs gatherND.
Here are the notes I took when I did the conversion:
- Remove all GatherND from the model - modify the centernet meta arch so that all tf.gather_nd nodes are replaced with tf.gather with batch_dims=0. I’m assuming batch_size=1. (modified center_net_meta_arch.py)
- remove multiclass_scores output as I didn’t need it and that branch contained some GatherNDs
- Use graph surgeon to remove the image resizing and replace it with RGB normalization and NCHW reorder (modified create_onnx.py from the efficientdet sample)
- use graph surgeon to make resize nodes use the floor mode