I am trying to convert the keras‘ model to TensorRTengine. My model contains CNN layer and GRU layer. And I use tensorrt python API to do this.At the same time, I build the engine successfully.But accuracy drops a lot.And I can't find what caused it.
Through testing, I found that the output of the layer before the GRU layer is consistent with the output of keras.But after adding the GRU layer, the output is much different. So I can confirm that the problem is caused by the GRU layer.But I can’t find a specific reason.This problem has bothered me for a long time.
keras code show as below:
from keras.layers import Bidirectional, GRU
gru_layer = Bidirectional(GRU(256, return_sequences=True), name='gru_layer')(input)
I am trying to convert the keras‘ model to TensorRTengine. My model contains CNN layer and GRU layer. And I use tensorrt python API to do this.At the same time, I build the engine successfully.But accuracy drops a lot.And I can't find what caused it.
Through testing, I found that the output of the layer before the GRU layer is consistent with the output of keras.But after adding the GRU layer, the output is much different. So I can confirm that the problem is caused by the GRU layer.But I can’t find a specific reason.This problem has bothered me for a long time.
keras code show as below:
tensorrt code show as below:
Environment:
Can anyone help me solve it?