Problems converting InferSent model into ONNX


I am trying to convert InferSent pre-trained model into ONNX (
which can be downloaded using this,
curl -Lo encoder/infersent.allnli.pickle

and loaded into PyTorch by this
model = torch.load(‘infersent.allnli.pickle’, map_location=lambda storage, loc: storage)

However, while saving it into Onnx using the below code, I get
"ValueError: NestedIOFunction doesn’t know how to process an input object of type models.BLSTMEncoder"

import torch.onnx
import torchvision
torch.onnx.export(model, _, “infersent.proto”, verbose=True)

Any help will be appreciated.

1 Like


Did you find a way to solve this? I am in similar situation now, any advise is appreciated.

Can you try this

I don’t have a problem while loading the pre trained model, i am getting issues while converting it to onnx.