Attempting from_onnx, dimension 1 conflicts 0/1 on conv2d_transpose

Hi, I’m attempting to compile CenterTrack with TVM. I’ve used the CT repo’s onnx conversion script to export a model.onnx file (I have torch==1.3 installed).

I’m now attempting to follow the Compile ONNX Models tutorial.

I’ve opened my model.onnx file in Netron to view the inputs, which are:

input_shapes = {'input.1': (1,3,736,1280), 'input.4: (1,3,736,1280), 'input.7': (1,3,736,1280)} (This is a tracking model which uses the current image, previous image frame, and a single-channel heatmap output from previous frame)

I’ve built TVM from source including both CUDA and LLVM. I’ve tried both targets on the step titled, " Compile the model with relay", however, at the line: mod, params = relay.frontend.from_onnx(onnx_model, shape_dict)

I get the following error on a conv2d_transpose layer:

  %187 = nn.relu(%186);
  %188 = nn.conv2d_transpose(%187, %dla_up.ida_0.up_1.weight, channels=1, kernel_size=[4, 4], strides=[2, 2], padding=[1, 1, 1, 1], groups=256) in particular dimension 1 conflicts 0 does not match 1; unable to unify: `Tensor[(256, 0, 4, 4), float32]` and `Tensor[(256, 1, 4, 4), float32]`; ;
  add(%188, %155)
}

Does anyone know what this means and how I can solve it?

It looks like something does go wrong during the parsing. Relay is telling you that the input tensor has shape [256, 0, 4, 4], with the 0 representing the number of channels, while it expects it to have shape [256, 1, 4, 4]. So for some reason the shape propagation during parsing is ending up at 0 instead of 1. I’ll take a look and see if i can figure out what specifically is going wrong.

Can you post the arguments you used in CenterTrack’s onnx conversion script?

Hmm do you know what common causes for that might be? Sure here’s how I ran the onnx conversion script, it should download weights if none are passed:

python3 -u convert_onnx.py tracking \
--exp_id onnx_001 \
--dataset mydata --dataset_version v1 \
--pre_hm --ltrb_amodal \
--same_aug --hm_disturb 0.05 \
--lost_disturb 0.4 --fp_disturb 0.1 \
--gpus 0,1 \
--input_h 736 --input_w 1280 \
--arch 'dla_34' --dla_node 'conv' \
> onnx_001.txt 2>&1 &