I have tried to load the trained model from the pytorch into caffe2 or TensorRT.
First, export onnx format then read it in caffe2.
-> It is ok for python. But I can’t figure out how to do it for c++. I meant I can’t find caffe2 api for onnx backend.
First, export onnx format then read it in TensorRT.
-> My model includes CNN and LSTM layer like this (CNN-Pool-CNN-Pool-Reshape-LSTM).
-> The input shape of pytorch’s LSTM is (seq x batch x feat). So I reshaped the tensor from Pool layer from (batch x channel x 1 x width) to (seq x batch x feat).
-> But, TensorRT doesn’t support moving the batch dim.
I think case 2) is related in TensorRT. But case 1) is related in pytorch/caffe2.