You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, my input is
input (1, 257, 1, 2)
state_h (1, 31, 32)
state_c (1, 32, 32)
May I ask how I should create the correct Mat data type for ncnn inference?
The text was updated successfully, but these errors were encountered:
Thank you for your reply. I have a question, please check it. eg:
import torch as nn
class TestLstm(nn.Module):
def init(self, input_size, hidden_size, rnn_type='LSTM', droupt=0, bidirectional=False):
super(TestLstm, self).init()
self.rnn = nn.LSTM(input_size, hidden_size, 1, dropout=dropout, batch_first=True, bidirectional=False)
if name == "main":
model = TestLstm(input_size=64, hidden_size=64, rnn_type='LSTM', dropout=0, bidirectional=False)
model.eval()
x = torch.randn(1, 64, 31, 1)
state_h0 = torch.randn(1, 31, 64, requires_grad=False)
state_c0 = torch.randn(1, 31, 64, requires_grad=False)
state_in = [(state_h0, state_c0)]
out, state_out = model(x, state_in[0])
onnx2ncnn:
.param
The lstm layer in the.param file is similar:
LSTM /lstm_t1/LSTM 3 3 x state_h0 state_c0 /lstm_t1/Transpose_1_out_0 state_out_h0 state_out_c0 0=32 1=8192 2=0
problem:The ncnn inference result is inconsistent with the onnx result, and I cannot align all the results. I don't know whether I used it correctly, and could you please help verify it, thanks
Hello, my input is
input (1, 257, 1, 2)
state_h (1, 31, 32)
state_c (1, 32, 32)
May I ask how I should create the correct Mat data type for ncnn inference?
The text was updated successfully, but these errors were encountered: