import torch
def main():
data=torch.rand(1, 2, 2, 3)
print("input", data)
print(data.size())
model=torch.nn.Upsample((4, 6), mode='bilinear', align_corners=True)
pre=model(data)
print("output", pre)
print(pre.size())
print("Transform the model to proto")
torch.onnx.export(model, data, "model.proto", verbose=True)
main()
when I run the code upside, I got the problem as follow:
TypeError: upsample_bilinear2d() got an unexpected keyword argument 'align_corners' (occurred when translating upsample_bilinear2d)
It seems that the function has already updated, the old transform function can not support the new function.
How can I solve this, Thanks.