I have trained a tensorflow DL network and would like to use it to run inference. To do that, I need to convert the tensorflow checkpoint to uff. I did the following:
I trained my network on a GPU workstation
I have converted the network tensorflow checkpoint to frozen graph on the GPU workstation
I then transfer the frozen graph to another GPU workstation which has uff installed.
On the second GPU workstation, I printed out the node names of all nodes in the frozen graph. I saw the output nodes I needed.
I then use the following code to convert my frozen graph pb to uff:
“ArgMax” for lanenet_model/vgg_backend/binary_seg/ArgMax, and
“Identity” for lanenet_model/vgg_backend/instance_seg/pix_embedding_conv/pix_embedding_conv
The information you shared in comment#8 is pretty helpful.
One of you output layer type is “Identity” which will be skipped when generating uff model.
Here are two possible solution for your reference: 1. Remove the layer directly. Since it is an Identity operation, the result won’t be changed. 2. Mark the layer right before Identity to be the output.
I have used the node in front of Identity. However, I found there is another output node in my network which is ArgMax, which is not supported my Tensorrt. Any opensource code implement this node in Tensorrt?
I was able to successfully convert lanenet model to uff. However, I do not how to use it to run inference. I have been reading Jetson-Inference on github, but still do not know how to write the C++ code. What I want to process a live video feed and for each frame, output a instance image and a binary image.
I was able to write some code to convert Lanenet Tensorflow check point with ArgMax to UFF and load it with tensorrt c++. However, when I ran the program, I got the following error:
[E] [TRT] UffParser: Parser error: lanenet_model/vgg_backend/binary_seg/ArgMax: Reductions cannot be applied to the batch dimension.
[E] Failure while parsing UFF file
I fixed this problem by dropping ArgMax when converting pb to uff.
As the error says, “Reduction cannot be applied to the batch dimension”. It might be a misuse or a bug of “dimension = -1”.
So now your tensorrt output the is the original input of ArgMax, do you still need ArgMax for your application? DO you plan to implement it outside of Tensorflow?
@AutoCar, no need to implement it outside of TensorFlow. Avoid using “dimension = -1”, in your case “dimension = 1”.
PS: TensorFlow uses NHWC instead of NCHW, you might need to reorder you image input if you want to compare the output features.