vision
vision copied to clipboard
torchvision Resize export doesn't support antialias=True, ::_upsample_bicubic2d_aa to ONNX opset version 16 is not supported
🐛 Describe the bug
'''python
resize = torchvision.transforms.Resize(size=(224, 224), interpolation=torchvision.transforms.InterpolationMode.BICUBIC, max_size=None, antialias=True)
dummy_input = torch.randn(1,3,2000,2000)
torch.onnx.export(resize, dummy_input, preprocess_model_path, input_names=['image'], output_names=['processed_image'], dynamic_axes={
# dict value: manually named axes
"image": {2:'h', 3:'w'},
})
'''
error "torch.onnx.symbolic_registry.UnsupportedOperatorError: Exporting the operator ::_upsample_bicubic2d_aa to ONNX opset version 16 is not supported."
Versions
ONNX opset version 16 is not supported
cc @neginraoof @BowenBao
seems it's available since opset 18: onnx/Operators.md at main · onnx/onnx (github.com) , can we support it?
@BowenBao could you offer your thoughts here?
Hi, @datumbox @BowenBao , want to follow up on this thread :)
Hi @tobaiMS thanks for reporting. we are blocked on https://github.com/pytorch/pytorch/pull/83201 moving ONNX to opset18 inside PyTorch. Once that is merged, this issue can be attempted by using the opset18 Resize. Tracking this issue in our project board.
#83201 was merged. feel free to retry and reopen the issue if the issue persists