Different results in TensorRT vs TF Keras

Hey everyone,

I have a Unet model that I trained using Keras implemented in TensorFlow. When running in plain TensorFlow the model gives expected output but after converting the model to a UFF and then an engine to be run in TensorRT I am getting different results on the same input.

I’ve printed the output tensor in both cases and the values of the output from TensorRT are much lower than the same model in TensorFlow.

Does anyone have an idea of why this would be the case and any potential solutions?

Thank you!

We haven’t done extensive testing but I think I seem to have figured out what the issue was. We were using softmax activation on the last convolutional layer of the Unet and for whatever reason that was not behaving correctly in TensorRT.

I continued to get the wrong output in TensorRT until I swapped the softmax activation for sigmoid activation.