3d Keras Optimize on Tensor Rt

Hello,

I have a keras 3d convolutional model that I would like to optimize on Tensor RT. I have successfully converted the .h5 into a .pb, and the .pb into a onnx file. I am trying to optimize this onnx model with tensor rt with this script:

However this returns a plugin error for max pooling 3d. I am not sure why I am receiving this error because I have tensor rt 7 and I thought it provides support for 3d convolution and pooling, How do I solve this?

Hi,

There are some limitation in the 3D pooling.
Would you mind to check if your model is supported by both TensorRT API and onnx2trt first?

TensorRT: Support Matrix :: NVIDIA Deep Learning TensorRT Documentation
ONNX2TRT: https://github.com/onnx/onnx-tensorrt/blob/master/operators.md

Thanks.

From what I’ve read, it shows support for 2d and 3d for pooling. However, I am unsure on max pooling because Onnx2TRT simply says yes for max pooling. Release Notes :: NVIDIA Deep Learning TensorRT Documentation shows support for pooling.
Here is my onnx file in case you want to try it out:
https://drive.google.com/file/d/1Doj9sZWI7KrBT2_-aTQoNhxZx6Zxvdb3/view?usp=sharing

Any follow ups?

Hi,

Sorry for the late update.

It looks like ONNX2TRT only support MaxPool and no MaxPool3D operation support.

Here are two possible workarounds for your reference.

  1. Add the MaxPool3D support into ONNX2TRT.
  2. Update the operation into MaxPool when generating the onnx model from your .pb file.

Thanks.