[RELAY][KERAS][TEST] test_forward_merge case not working outside tvm folder


#1

Hi. I’m trying to run the test_forward_merge function in another environment, but I’m getting this error:

In main:
v0.0.4
fn (%input_1: Tensor[(1, 32, 32, 3), float32], %v_param_1: Tensor[(8, 3, 3, 3), float32], %v_param_2: Tensor[(8), float32], %v_param_3: Tensor[(8, 8, 3, 3), float32], %v_param_4: Tensor[(8), float32], %v_param_5: Tensor[(8, 8, 3, 3), float32], %v_param_6: Tensor[(8), float32]) {
%0 = nn.conv2d(%input_1, %v_param_1, padding=[1, 1], channels=8, kernel_size=[3, 3]) in particular dimension 1 conflicts 32 does not match 3; unable to unify: Tensor[(8, 32, 3, 3), float32] and Tensor[(8, 3, 3, 3), float32]; ;
%1 = nn.bias_add(%0, %v_param_2);
%2 = nn.conv2d(%1, %v_param_3, padding=[1, 1], channels=8, kernel_size=[3, 3]);
%3 = nn.bias_add(%2, %v_param_4);
%4 = nn.conv2d(%3, %v_param_5, padding=[1, 1], channels=8, kernel_size=[3, 3]);
%5 = nn.bias_add(%4, %v_param_6);
%6 = (%1, %3, %5);
concatenate(%6, axis=1)
}

but when I run it from your location in tvm, it works fine. Is there something wrong with my environment?


#2

It should be this:
def @main(%input_1: Tensor[(1, 3, 32, 32), float32], %v_param_1: Tensor[(8, 3, 3, 3), float32], %v_param_2: Tensor[(8), float32], %v_param_3: Tensor[(8, 8, 3, 3), float32], %v_param_4: Tensor[(8), float32], %v_param_5: Tensor[(8, 8, 3, 3), float32], %v_param_6: Tensor[(8), float32]) -> Tensor[(1, 8, 32, 32), float32] {
%0 = nn.conv2d(%input_1, %v_param_1, padding=[1, 1], channels=8, kernel_size=[3, 3]) /* ty=Tensor[(1, 8, 32, 32), float32] /;
%1 = nn.bias_add(%0, %v_param_2) /
ty=Tensor[(1, 8, 32, 32), float32] /;
%2 = nn.conv2d(%1, %v_param_3, padding=[1, 1], channels=8, kernel_size=[3, 3]) /
ty=Tensor[(1, 8, 32, 32), float32] /;
%3 = nn.bias_add(%2, %v_param_4) /
ty=Tensor[(1, 8, 32, 32), float32] /;
%4 = add(%1, %3) /
ty=Tensor[(1, 8, 32, 32), float32] /;
%5 = nn.conv2d(%3, %v_param_5, padding=[1, 1], channels=8, kernel_size=[3, 3]) /
ty=Tensor[(1, 8, 32, 32), float32] /;
%6 = nn.bias_add(%5, %v_param_6) /
ty=Tensor[(1, 8, 32, 32), float32] /;
add(%4, %6) /
ty=Tensor[(1, 8, 32, 32), float32] */
}