vision icon indicating copy to clipboard operation
vision copied to clipboard

torchvision Resize export doesn't support antialias=True, ::_upsample_bicubic2d_aa to ONNX opset version 16 is not supported

Open tobaiMS opened this issue 3 years ago • 5 comments
trafficstars

🐛 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

tobaiMS avatar Oct 20 '22 21:10 tobaiMS

seems it's available since opset 18: onnx/Operators.md at main · onnx/onnx (github.com) , can we support it?

tobaiMS avatar Oct 25 '22 22:10 tobaiMS

@BowenBao could you offer your thoughts here?

datumbox avatar Oct 26 '22 09:10 datumbox

Hi, @datumbox @BowenBao , want to follow up on this thread :)

tobaiMS avatar Nov 08 '22 18:11 tobaiMS

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.

BowenBao avatar Nov 09 '22 18:11 BowenBao

#83201 was merged. feel free to retry and reopen the issue if the issue persists

thiagocrepaldi avatar Apr 30 '24 22:04 thiagocrepaldi