when i convert network with bilinear layer trained on Pytorch to ONNX, i get following error
RuntimeError: [ONNXRuntimeError] : 10 : INVALID_GRAPH : Load model from test.onnx failed:Type Error: Type 'tensor(int64)' of input parameter (11) of operator (Floor) in node () is invalid.
I m not sure on why this error occurs, I tried building ONNX from source but still the issue dosen't seems to go way.
Any ideas on what might cause this error? or how to tackle the issue?
Way to Reproduce-
from torch import nn
import torch
import torch.nn.functional as F
import onnxruntime as rt
class Upsample(torch.nn.Module):
def forward(self, x):
#l = nn.Conv2d(3, 3, kernel_size=1, stride=1, padding=1, bias=True)
return F.interpolate(x, scale_factor=2, mode="bilinear", align_corners=False)
m = Upsample()
v = torch.randn(1,3,128,128, dtype=torch.float32, requires_grad=False)
torch.onnx.export(m, v, "test.onnx")
sess = rt.InferenceSession("test.onnx")