模型是用jacinto-ai/pytorch-jacinto-ai-devkit中的mobilenetv1,并对tidl的一些要求做了些修改(flatten层用reshape代替),生成的onnx模型在pc上推演正常。但部署到开发板后运行时得不到正确的结果
转换时用的配置
randParams = 0 modelType = 2 quantRoundAdd = 25 inElementType = 0 rawSampleInData = 1 foldBnInConv2D = 1 numParamBits = 8 Conv2dKernelType = 0 preProcType = 0 inWidth = 224 inHeight = 224 inNumChannels = 3 inputNetFile = "mobilenetv1.onnx" outputNetFile = "tidl_net_mobilenetv1.bin" outputParamsFile = "tidl_param_mobilenetv1.bin" sampleInData = "sample_img_256x256.raw" tidlStatsTool = "eve_test_dl_algo.out"
转换时的输出
tidl_model_import.out ./tr.txt
TF Model (Proto) File : mobilenetv1.onnx
TIDL Network File : tidl_net_mobilenetv1.bin
TIDL Params File : tidl_param_mobilenetv1.bin
Pading Only supported in H and W axis
Pading Only supported in H and W axis
Pading Only supported in H and W axis
Pading Only supported in H and W axis
Pading Only supported in H and W axis
Pading Only supported in H and W axis
Pading Only supported in H and W axis
Pading Only supported in H and W axis
Pading Only supported in H and W axis
Pading Only supported in H and W axis
Pading Only supported in H and W axis
Pading Only supported in H and W axis
Pading Only supported in H and W axis
Pading Only supported in H and W axis
Only float and INT64 tensor is suported
Number of original layers: 58
Number of layers after tidl_addInDataLayer: 59
Number of layers after tidl_sortLayersInProcOrder: 59
Number of layers after tidl_removeMergedLayersFromNet: 59
Number of layers after second tidl_removeMergedLayersFromNet: 32
Number of layers after third tidl_removeMergedLayersFromNet: 31
Num of Layer Detected : 31
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Num|TIDL Layer Name |Out Data Name |Group |#Ins |#Outs |Inbuf Ids |Outbuf Id |In NCHW |Out NCHW |MACS |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0|TIDL_DataLayer |input.1 | 0| -1| 1| x x x x x x x x | 0 | 0 0 0 0 | 1 3 224 224 | 0 |
1|TIDL_ConvolutionLayer |input.8 | 1| 1| 1| 0 x x x x x x x | 1 | 1 3 224 224 | 1 32 112 112 | 11239424 |
2|TIDL_ConvolutionLayer |input.20 | 1| 1| 1| 1 x x x x x x x | 2 | 1 32 112 112 | 1 32 112 112 | 4014080 |
3|TIDL_ConvolutionLayer |input.32 | 1| 1| 1| 2 x x x x x x x | 3 | 1 32 112 112 | 1 64 112 112 | 26492928 |
4|TIDL_ConvolutionLayer |input.44 | 1| 1| 1| 3 x x x x x x x | 4 | 1 64 112 112 | 1 64 56 56 | 2007040 |
5|TIDL_ConvolutionLayer |input.56 | 1| 1| 1| 4 x x x x x x x | 5 | 1 64 56 56 | 1 128 56 56 | 26091520 |
6|TIDL_ConvolutionLayer |input.68 | 1| 1| 1| 5 x x x x x x x | 6 | 1 128 56 56 | 1 128 56 56 | 4014080 |
7|TIDL_ConvolutionLayer |input.80 | 1| 1| 1| 6 x x x x x x x | 7 | 1 128 56 56 | 1 128 56 56 | 51781632 |
8|TIDL_ConvolutionLayer |input.92 | 1| 1| 1| 7 x x x x x x x | 8 | 1 128 56 56 | 1 128 28 28 | 1003520 |
9|TIDL_ConvolutionLayer |input.104 | 1| 1| 1| 8 x x x x x x x | 9 | 1 128 28 28 | 1 256 28 28 | 25890816 |
10|TIDL_ConvolutionLayer |input.116 | 1| 1| 1| 9 x x x x x x x | 10 | 1 256 28 28 | 1 256 28 28 | 2007040 |
11|TIDL_ConvolutionLayer |input.128 | 1| 1| 1| 10 x x x x x x x | 11 | 1 256 28 28 | 1 256 28 28 | 51580928 |
12|TIDL_ConvolutionLayer |input.140 | 1| 1| 1| 11 x x x x x x x | 12 | 1 256 28 28 | 1 256 14 14 | 501760 |
13|TIDL_ConvolutionLayer |input.152 | 1| 1| 1| 12 x x x x x x x | 13 | 1 256 14 14 | 1 512 14 14 | 25790464 |
14|TIDL_ConvolutionLayer |input.164 | 1| 1| 1| 13 x x x x x x x | 14 | 1 512 14 14 | 1 512 14 14 | 1003520 |
15|TIDL_ConvolutionLayer |input.176 | 1| 1| 1| 14 x x x x x x x | 15 | 1 512 14 14 | 1 512 14 14 | 51480576 |
16|TIDL_ConvolutionLayer |input.188 | 1| 1| 1| 15 x x x x x x x | 16 | 1 512 14 14 | 1 512 14 14 | 1003520 |
17|TIDL_ConvolutionLayer |input.200 | 1| 1| 1| 16 x x x x x x x | 17 | 1 512 14 14 | 1 512 14 14 | 51480576 |
18|TIDL_ConvolutionLayer |input.212 | 1| 1| 1| 17 x x x x x x x | 18 | 1 512 14 14 | 1 512 14 14 | 1003520 |
19|TIDL_ConvolutionLayer |input.224 | 1| 1| 1| 18 x x x x x x x | 19 | 1 512 14 14 | 1 512 14 14 | 51480576 |
20|TIDL_ConvolutionLayer |input.236 | 1| 1| 1| 19 x x x x x x x | 20 | 1 512 14 14 | 1 512 14 14 | 1003520 |
21|TIDL_ConvolutionLayer |input.248 | 1| 1| 1| 20 x x x x x x x | 21 | 1 512 14 14 | 1 512 14 14 | 51480576 |
22|TIDL_ConvolutionLayer |input.260 | 1| 1| 1| 21 x x x x x x x | 22 | 1 512 14 14 | 1 512 14 14 | 1003520 |
23|TIDL_ConvolutionLayer |input.272 | 1| 1| 1| 22 x x x x x x x | 23 | 1 512 14 14 | 1 512 14 14 | 51480576 |
24|TIDL_ConvolutionLayer |input.284 | 1| 1| 1| 23 x x x x x x x | 24 | 1 512 14 14 | 1 512 7 7 | 250880 |
25|TIDL_ConvolutionLayer |input.296 | 1| 1| 1| 24 x x x x x x x | 25 | 1 512 7 7 | 1 1024 7 7 | 25740288 |
26|TIDL_ConvolutionLayer |input.308 | 1| 1| 1| 25 x x x x x x x | 26 | 1 1024 7 7 | 1 1024 7 7 | 501760 |
27|TIDL_ConvolutionLayer |x | 1| 1| 1| 26 x x x x x x x | 27 | 1 1024 7 7 | 1 1024 7 7 | 51430400 |
28|TIDL_PoolingLayer |onnx::Gemm_248 | 1| 1| 1| 27 x x x x x x x | 28 | 1 1024 7 7 | 1 1 1 1024 | 2048 |
29|TIDL_InnerProductLayer |onnx::Softmax_249 | 1| 1| 1| 28 x x x x x x x | 29 | 1 1 1 1024 | 1 1 1 9 | 9225 |
30|TIDL_SoftMaxLayer |250 | 1| 1| 1| 29 x x x x x x x | 30 | 1 1 1 9 | 1 1 1 9 | 9 |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total Giga Macs : 0.5728
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Processing config file ./tempDir/qunat_stats_config.txt !
0, TIDL_DataLayer , 0, -1 , 1 , x , x , x , x , x , x , x , x , 0 , 0 , 0 , 0 , 0 , 1 , 3 , 224 , 224 ,
1, TIDL_ConvolutionLayer , 1, 1 , 1 , 0 , x , x , x , x , x , x , x , 1 , 1 , 3 , 224 , 224 , 1 , 32 , 112 , 112 ,
2, TIDL_ConvolutionLayer , 1, 1 , 1 , 1 , x , x , x , x , x , x , x , 2 , 1 , 32 , 112 , 112 , 1 , 32 , 112 , 112 ,
3, TIDL_ConvolutionLayer , 1, 1 , 1 , 2 , x , x , x , x , x , x , x , 3 , 1 , 32 , 112 , 112 , 1 , 64 , 112 , 112 ,
4, TIDL_ConvolutionLayer , 1, 1 , 1 , 3 , x , x , x , x , x , x , x , 4 , 1 , 64 , 112 , 112 , 1 , 64 , 56 , 56 ,
5, TIDL_ConvolutionLayer , 1, 1 , 1 , 4 , x , x , x , x , x , x , x , 5 , 1 , 64 , 56 , 56 , 1 , 128 , 56 , 56 ,
6, TIDL_ConvolutionLayer , 1, 1 , 1 , 5 , x , x , x , x , x , x , x , 6 , 1 , 128 , 56 , 56 , 1 , 128 , 56 , 56 ,
7, TIDL_ConvolutionLayer , 1, 1 , 1 , 6 , x , x , x , x , x , x , x , 7 , 1 , 128 , 56 , 56 , 1 , 128 , 56 , 56 ,
8, TIDL_ConvolutionLayer , 1, 1 , 1 , 7 , x , x , x , x , x , x , x , 8 , 1 , 128 , 56 , 56 , 1 , 128 , 28 , 28 ,
9, TIDL_ConvolutionLayer , 1, 1 , 1 , 8 , x , x , x , x , x , x , x , 9 , 1 , 128 , 28 , 28 , 1 , 256 , 28 , 28 ,
10, TIDL_ConvolutionLayer , 1, 1 , 1 , 9 , x , x , x , x , x , x , x , 10 , 1 , 256 , 28 , 28 , 1 , 256 , 28 , 28 ,
11, TIDL_ConvolutionLayer , 1, 1 , 1 , 10 , x , x , x , x , x , x , x , 11 , 1 , 256 , 28 , 28 , 1 , 256 , 28 , 28 ,
12, TIDL_ConvolutionLayer , 1, 1 , 1 , 11 , x , x , x , x , x , x , x , 12 , 1 , 256 , 28 , 28 , 1 , 256 , 14 , 14 ,
13, TIDL_ConvolutionLayer , 1, 1 , 1 , 12 , x , x , x , x , x , x , x , 13 , 1 , 256 , 14 , 14 , 1 , 512 , 14 , 14 ,
14, TIDL_ConvolutionLayer , 1, 1 , 1 , 13 , x , x , x , x , x , x , x , 14 , 1 , 512 , 14 , 14 , 1 , 512 , 14 , 14 ,
15, TIDL_ConvolutionLayer , 1, 1 , 1 , 14 , x , x , x , x , x , x , x , 15 , 1 , 512 , 14 , 14 , 1 , 512 , 14 , 14 ,
16, TIDL_ConvolutionLayer , 1, 1 , 1 , 15 , x , x , x , x , x , x , x , 16 , 1 , 512 , 14 , 14 , 1 , 512 , 14 , 14 ,
17, TIDL_ConvolutionLayer , 1, 1 , 1 , 16 , x , x , x , x , x , x , x , 17 , 1 , 512 , 14 , 14 , 1 , 512 , 14 , 14 ,
18, TIDL_ConvolutionLayer , 1, 1 , 1 , 17 , x , x , x , x , x , x , x , 18 , 1 , 512 , 14 , 14 , 1 , 512 , 14 , 14 ,
19, TIDL_ConvolutionLayer , 1, 1 , 1 , 18 , x , x , x , x , x , x , x , 19 , 1 , 512 , 14 , 14 , 1 , 512 , 14 , 14 ,
20, TIDL_ConvolutionLayer , 1, 1 , 1 , 19 , x , x , x , x , x , x , x , 20 , 1 , 512 , 14 , 14 , 1 , 512 , 14 , 14 ,
21, TIDL_ConvolutionLayer , 1, 1 , 1 , 20 , x , x , x , x , x , x , x , 21 , 1 , 512 , 14 , 14 , 1 , 512 , 14 , 14 ,
22, TIDL_ConvolutionLayer , 1, 1 , 1 , 21 , x , x , x , x , x , x , x , 22 , 1 , 512 , 14 , 14 , 1 , 512 , 14 , 14 ,
23, TIDL_ConvolutionLayer , 1, 1 , 1 , 22 , x , x , x , x , x , x , x , 23 , 1 , 512 , 14 , 14 , 1 , 512 , 14 , 14 ,
24, TIDL_ConvolutionLayer , 1, 1 , 1 , 23 , x , x , x , x , x , x , x , 24 , 1 , 512 , 14 , 14 , 1 , 512 , 7 , 7 ,
25, TIDL_ConvolutionLayer , 1, 1 , 1 , 24 , x , x , x , x , x , x , x , 25 , 1 , 512 , 7 , 7 , 1 , 1024 , 7 , 7 ,
26, TIDL_ConvolutionLayer , 1, 1 , 1 , 25 , x , x , x , x , x , x , x , 26 , 1 , 1024 , 7 , 7 , 1 , 1024 , 7 , 7 ,
27, TIDL_ConvolutionLayer , 1, 1 , 1 , 26 , x , x , x , x , x , x , x , 27 , 1 , 1024 , 7 , 7 , 1 , 1024 , 7 , 7 ,
28, TIDL_PoolingLayer , 1, 1 , 1 , 27 , x , x , x , x , x , x , x , 28 , 1 , 1024 , 7 , 7 , 1 , 1 , 1 , 1024 ,
29, TIDL_InnerProductLayer , 1, 1 , 1 , 28 , x , x , x , x , x , x , x , 29 , 1 , 1 , 1 , 1024 , 1 , 1 , 1 , 9 ,
30, TIDL_SoftMaxLayer , 1, 1 , 1 , 29 , x , x , x , x , x , x , x , 30 , 1 , 1 , 1 , 9 , 1 , 1 , 1 , 9 ,
31, TIDL_DataLayer , 0, 1 , -1 , 30 , x , x , x , x , x , x , x , 0 , 1 , 1 , 1 , 9 , 0 , 0 , 0 , 0 ,
Layer ID ,inBlkWidth ,inBlkHeight ,inBlkPitch ,outBlkWidth ,outBlkHeight,outBlkPitch ,numInChs ,numOutChs ,numProcInChs,numLclInChs ,numLclOutChs,numProcItrs ,numAccItrs ,numHorBlock ,numVerBlock ,inBlkChPitch,outBlkChPitc,alignOrNot
1 72 60 72 32 28 32 3 32 3 1 8 1 3 4 4 4320 896 1
2 40 30 40 32 28 32 1 1 1 1 1 1 1 4 4 1200 896 1
3 32 28 32 32 28 32 32 64 32 8 8 1 4 4 4 896 896 1
4 72 60 72 32 28 32 1 1 1 1 1 1 1 2 2 4320 896 1
5 32 28 32 32 28 32 64 128 64 8 8 1 8 2 2 896 896 1
6 40 30 40 32 28 32 1 1 1 1 1 1 1 2 2 1200 896 1
7 32 28 32 32 28 32 128 128 128 8 8 1 16 2 2 896 896 1
8 72 60 72 32 28 32 1 1 1 1 1 1 1 1 1 4320 896 1
9 32 28 32 32 28 32 128 256 128 8 8 1 16 1 1 896 896 1
10 40 30 40 32 28 32 1 1 1 1 1 1 1 1 1 1200 896 1
11 32 28 32 32 28 32 256 256 256 8 8 1 32 1 1 896 896 1
12 40 32 40 16 14 16 1 1 1 1 1 1 1 1 1 1280 224 1
13 16 14 16 16 14 16 256 512 256 8 8 1 32 1 1 224 224 1
14 24 16 24 16 14 16 1 1 1 1 1 1 1 1 1 384 224 1
15 16 14 16 16 14 16 512 512 512 8 8 1 64 1 1 224 224 1
16 24 16 24 16 14 16 1 1 1 1 1 1 1 1 1 384 224 1
17 16 14 16 16 14 16 512 512 512 8 8 1 64 1 1 224 224 1
18 24 16 24 16 14 16 1 1 1 1 1 1 1 1 1 384 224 1
19 16 14 16 16 14 16 512 512 512 8 8 1 64 1 1 224 224 1
20 24 16 24 16 14 16 1 1 1 1 1 1 1 1 1 384 224 1
21 16 14 16 16 14 16 512 512 512 8 8 1 64 1 1 224 224 1
22 24 16 24 16 14 16 1 1 1 1 1 1 1 1 1 384 224 1
23 16 14 16 16 14 16 512 512 512 8 8 1 64 1 1 224 224 1
24 40 18 40 16 7 16 1 1 1 1 1 1 1 1 1 720 112 1
25 16 7 16 16 7 16 512 1024 512 8 8 1 64 1 1 112 112 1
26 24 9 24 16 7 16 1 1 1 1 1 1 1 1 1 216 112 1
27 16 7 16 16 7 16 1024 1024 1024 8 8 1 128 1 1 112 112 1
Processing Frame Number : 0
Layer 1 : Out Q : 1 , TIDL_ConvolutionLayer, PASSED #MMACs = 10.84, 13.20, Sparsity : -21.76
Layer 2 : Out Q : 1 , TIDL_ConvolutionLayer, PASSED #MMACs = 3.61, 3.61, Sparsity : 0.00
Layer 3 : Out Q : 1 , TIDL_ConvolutionLayer, PASSED #MMACs = 25.69, 23.33, Sparsity : 9.18
Layer 4 : Out Q : 1 , TIDL_ConvolutionLayer, PASSED #MMACs = 1.81, 1.81, Sparsity : 0.00
Layer 5 : Out Q : 1 , TIDL_ConvolutionLayer, PASSED #MMACs = 25.69, 22.64, Sparsity : 11.87
Layer 6 : Out Q : 1 , TIDL_ConvolutionLayer, PASSED #MMACs = 3.61, 3.61, Sparsity : 0.00
Layer 7 : Out Q : 1 , TIDL_ConvolutionLayer, PASSED #MMACs = 51.38, 50.75, Sparsity : 1.22
Layer 8 : Out Q : 1 , TIDL_ConvolutionLayer, PASSED #MMACs = 0.90, 0.90, Sparsity : 0.00
Layer 9 : Out Q : 1 , TIDL_ConvolutionLayer, PASSED #MMACs = 25.69, 25.37, Sparsity : 1.25
Layer 10 : Out Q : 1 , TIDL_ConvolutionLayer, PASSED #MMACs = 1.81, 1.81, Sparsity : 0.00
Layer 11 : Out Q : 1 , TIDL_ConvolutionLayer, PASSED #MMACs = 51.38, 51.32, Sparsity : 0.12
Layer 12 : Out Q : 1 , TIDL_ConvolutionLayer, PASSED #MMACs = 0.45, 0.45, Sparsity : 0.00
Layer 13 : Out Q : 1 , TIDL_ConvolutionLayer, PASSED #MMACs = 25.69, 25.69, Sparsity : 0.01
Layer 14 : Out Q : 1 , TIDL_ConvolutionLayer, PASSED #MMACs = 0.90, 0.90, Sparsity : 0.00
Layer 15 : Out Q : 1 , TIDL_ConvolutionLayer, PASSED #MMACs = 51.38, 51.37, Sparsity : 0.02
Layer 16 : Out Q : 1 , TIDL_ConvolutionLayer, PASSED #MMACs = 0.90, 0.90, Sparsity : 0.00
Layer 17 : Out Q : 1 , TIDL_ConvolutionLayer, PASSED #MMACs = 51.38, 51.37, Sparsity : 0.02
Layer 18 : Out Q : 1 , TIDL_ConvolutionLayer, PASSED #MMACs = 0.90, 0.90, Sparsity : 0.00
Layer 19 : Out Q : 1 , TIDL_ConvolutionLayer, PASSED #MMACs = 51.38, 51.37, Sparsity : 0.01
Layer 20 : Out Q : 1 , TIDL_ConvolutionLayer, PASSED #MMACs = 0.90, 0.90, Sparsity : 0.00
Layer 21 : Out Q : 1 , TIDL_ConvolutionLayer, PASSED #MMACs = 51.38, 51.38, Sparsity : 0.01
Layer 22 : Out Q : 1 , TIDL_ConvolutionLayer, PASSED #MMACs = 0.90, 0.90, Sparsity : 0.00
Layer 23 : Out Q : 1 , TIDL_ConvolutionLayer, PASSED #MMACs = 51.38, 51.34, Sparsity : 0.07
Layer 24 : Out Q : 1 , TIDL_ConvolutionLayer, PASSED #MMACs = 0.23, 0.23, Sparsity : 0.00
Layer 25 : Out Q : 1 , TIDL_ConvolutionLayer, PASSED #MMACs = 25.69, 25.69, Sparsity : 0.02
Layer 26 : Out Q : 1 , TIDL_ConvolutionLayer, PASSED #MMACs = 0.45, 0.45, Sparsity : 0.00
Layer 27 : Out Q : 1 , TIDL_ConvolutionLayer, PASSED #MMACs = 51.38, 51.38, Sparsity : 0.01
Layer 28 : Out Q : 1 , TIDL_PoolingLayer, PASSED #MMACs = 0.00, 0.00, Sparsity : 0.00
Layer 29 : Out Q : 1 , TIDL_InnerProductLayer, PASSED #MMACs = 0.00, 0.00, Sparsity : 0.00
Layer 30 :-------Max Index 8 : 28 ------- #MMACs = 0.00, 0.00, Sparsity : 0.00
End of config list found !
转换过程中用的样本raw格式输入是用SDK手册中的脚本生成的,最后仿真工具生成的bin文件输出也不符合预期。
SDK版本:ti-processor-sdk-linux-rt-am57xx-evm-05.03.00.07
期待回复