I am trying to convert ESPNet (PyTorch as a backend) model into ONNX, but I’m getting error i.e. TypeError: forward() missing 2 required positional arguments: 'ilens' and 'ys_pad'
I am using this code for conversion. # Export the trained model to ONNX dummy_input = Variable(torch.randn(83,320)) # [83,320] will be the input to the model torch.onnx.export(model, dummy_input, "model.onnx")
Based on the error message it seems that your model expects more inputs to its forward method than the provided tensor.
Could you check, where ilens and ys_pad are used in your model?
Also, Variables are deprecated since PyTorch 0.4 so you can use tensors now.