ONNX dyn reshape causes EXC_BAD_ACCESS

Hello,

I tried to load dert (GitHub - facebookresearch/detr: End-to-End Object Detection with Transformers) by using ONNX frontend ang got EXC_BAD_ACCESS.

I converted network from PyTorch to ONNX by the following script:

from torch.autograd import Variable

import torch.onnx
import torchvision
import torch

dummy_input = Variable(torch.randn(1, 3, 256, 256))
model = torch.hub.load('facebookresearch/detr', 'detr_resnet50', pretrained=True)
torch.onnx.export(model, dummy_input, "detr_50.onnx", opset_version=11, verbose=True, input_names=['image'])

After I tried to load the converted network by using ONNX frontend and got crash here:

This is in file: src/relay/op/dyn/tensor/transform.cc

As you can see on the screen the crash is happen because we have dynamic shape in newshape->shape[0].

How can I fix it? Or maybe I should prepare the model in another way?

This issue looks sumular with the following question: Onnx Dynamic shape question?

And the following PR: [Relay][Frontend][Onnx] Refactor where importer to support dynamic shapes. by jwfromm · Pull Request #7394 · apache/tvm · GitHub