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
{{ message }}
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.
I want to export a protobuf of the LSTM-LM in ONNX, but I'm failing with the error:
"ValueError: Auto nesting doesn't know how to process an input object of type float. Accepted types: Tensors, or lists/tuples of them"
I modeled my export function after word_language model:
def export_onnx(path, batch_size, seq_len):
print('The model is also exported in ONNX format at {}'.
format(os.path.realpath(args.onnx_export)))
model.eval()
dummy_input = torch.LongTensor(seq_len * batch_size).zero().view(-1, batch_size).to(device)
hidden = model.init_hidden(batch_size)
torch.onnx.export(model, (dummy_input, hidden), path)_
Searching online reveals a similar issue that suggests the bug is fixed with the newest onnx update: OpenNMT/OpenNMT-py#638
Is it possible to get a protobuf of the AWD-LSTM LM?
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I want to export a protobuf of the LSTM-LM in ONNX, but I'm failing with the error:
"ValueError: Auto nesting doesn't know how to process an input object of type float. Accepted types: Tensors, or lists/tuples of them"
I modeled my export function after word_language model:
def export_onnx(path, batch_size, seq_len):
print('The model is also exported in ONNX format at {}'.
format(os.path.realpath(args.onnx_export)))
model.eval()
dummy_input = torch.LongTensor(seq_len * batch_size).zero().view(-1, batch_size).to(device)
hidden = model.init_hidden(batch_size)
torch.onnx.export(model, (dummy_input, hidden), path)_
Searching online reveals a similar issue that suggests the bug is fixed with the newest onnx update: OpenNMT/OpenNMT-py#638
Is it possible to get a protobuf of the AWD-LSTM LM?
The text was updated successfully, but these errors were encountered: