ResNet101 pytorch model : dimension conflicts in **PRELU** layer

Hi Team,

I am trying run ResNet101 pytorch model through TVM. This model I took from InsightFace-v2, and in the parser stage I hit with below error from the error message looks like the issue is related to dimension conflicts in PRELU layer.

Error message:

TVMError: Error(s) have occurred. The program has been annotated with them:

In main: v0.0.4 fn (%input0: Tensor[(1, 3, 112, 112), float32], %v39: Tensor[(64, 3, 1, 1), float32], %v62: Tensor[(64), float32], %v61: Tensor[(64), float32], %v60: Tensor[(64), float32], %v59: Tensor[(64), float32], %v68: Tensor[(64, 1, 1, 3), float32], %v91: Tensor[(64), float32], %v90: Tensor[(64), float32], %v89: Tensor[(64), float32], %v88: Tensor[(64), float32], %v97: Tensor[(64, 1, 3, 1), float32], %v120: Tensor[(64), float32], %v119: Tensor[(64), float32], %v118: Tensor[(64), float32], %v117: Tensor[(64), float32], %v126: Tensor[(1), float32]) { %0 = nn.conv2d(%input0, %v39, padding=[0, 0, 0, 0], channels=64, kernel_size=[1, 1]); %1 = nn.batch_norm(%0, %v62, %v61, %v60, %v59); %2 = %1.0; %3 = reshape(%v68, meta[relay.Constant][0], newshape=[64, 1, 1, 3]); %4 = nn.conv2d(%2, %3, padding=[0, 0, 0, 0], groups=64, channels=64, kernel_size=[1, 3]); %5 = nn.batch_norm(%4, %v91, %v90, %v89, %v88); %6 = %5.0; %7 = reshape(%v97, meta[relay.Constant][1], newshape=[64, 1, 3, 1]); %8 = nn.conv2d(%6, %7, padding=[0, 0, 0, 0], groups=64, channels=64, kernel_size=[3, 1]); %9 = nn.batch_norm(%8, %v120, %v119, %v118, %v117); %10 = %9.0; %11 = nn.prelu(%10, %v126) in particular dimension 0 conflicts 64 does not match 1; unable to unify: Tensor[(64), float32] and Tensor[(1), float32]; ; ** nn.max_pool2d(%11, pool_size=[2, 2], strides=[2, 2], padding=[0, 0, 0, 0])** } // meta data omitted. you can use show_meta_data=True to include meta data

Is it known issue? am I missing something here.

Kindly help me to solve this issue.

Note:

  1. I am able to run this model in standalone pytorch framework
  2. My TVM Commit ID: commit e369c5a9cbacb926ca7b95ebc4ae01a6de33c6cd

Thanks and Regards, Raju

@FrozenGene , Do you have any suggestions on this problem?

Thanks in advance Raju

@kvaju.454 could you share me the model? I suspect one reason but I want to make sure to run the model to make sure. It is better to give me one reproducible script.

Hi @FrozenGene,

Thanks for your quick reply. Here is the details to reproduce the issue

Steps to reproduce the issue:

  1. clone InsightFace repo: $git clone https://github.com/foamliu/InsightFace-v2 $cd InsightFace-v2
  2. Copy the attached files into InsightFace-v2 folder
  3. Run main_demo.py from InsightFace-V2 folder

$python3 main_demo.py

@FrozenGene, Below link has the inference script files. Kindly download and extract below compressed file into the InsightFace-v2 repo folder and run the above mentioned steps.

https://drive.google.com/file/d/1Y9-abKcto0xeylAYcdg6HF-0oobNgtU8/view?usp=sharing

@FrozenGene , Kindly help on this issue.

Thanks in advance. Raju

i could reproduce your problem. I think i could spare some time tomorrow to analyze it.

@FrozenGene Thanks a lot for spending your time on this. Please let me know if you need any information.