Tengine icon indicating copy to clipboard operation
Tengine copied to clipboard

infer shaped for node: MobilenetV1/MobilenetV1/Conv2d_0/Conv2D-MobilenetV1/MobilenetV1/Conv2d_0/BatchNorm/FusedBatchNorm-MobilenetV1/MobilenetV1/Conv2d_0/Relu6 op: Convolution failed

Open fathow666666 opened this issue 6 years ago • 3 comments

First i use the mobilent model in Tengine model zoo,it is able to run. Then I use the convert tool change tensorflow model to tengine model. When use the mobilentv1.tmfile to classifay ,i says the error that
infer shaped for node: MobilenetV1/MobilenetV1/Conv2d_0/Conv2D-MobilenetV1/MobilenetV1/Conv2d_0/BatchNorm/FusedBatchNorm-MobilenetV1/MobilenetV1/Conv2d_0/Relu6 op: Convolution failed Prerun graph failed

1 2 3

fathow666666 avatar Apr 04 '20 13:04 fathow666666

May you can try compare the differences between the two models? through Netron tools .
I will take a look at this problem .

liqi-c avatar Apr 07 '20 04:04 liqi-c

The input tensor shape of tensorflow model is [?,224,224,3],it means NHWC, but in the test code ,the definition of input tensor shape is [1,3,224,224], it means NCHW , you need change the test code.And try it again.

LEMON-LM avatar Apr 07 '20 07:04 LEMON-LM

@fathow666666 the tensorflow model format is NHWC , but in our code default is nchw ,so you can modify like this : ''' --- a/examples/classification.cpp +++ b/examples/classification.cpp @@ -67,7 +67,7 @@ bool run_tengine_library(const char* model_name, const char* tm_file, const char // set input int img_size = img_h * img_w * 3;

  • int dims[] = {1, 3, img_h, img_w};
  • int dims[] = {1, img_h, img_w ,3 }; '''

liqi-c avatar Apr 07 '20 07:04 liqi-c