我已经使用Android NDK r10e工具链成功编译了libtensorflow-lite.a和label_image,但是在Android设备上运行该应用程序时却崩溃了。
有人知道导致崩溃的原因吗?我认为在解释器-> AllocateTensors()的调用中崩溃了。
下面粘贴的是演示应用程序的输出。 (由于我没有为该设备配置远程gdb,因此目前无法获取堆栈跟踪。)
/data/tf $ ./label_image -v 1
WARNING: linker: ./label_image: unused DT entry: type 0xf arg 0x534
nnapi error: unable to open library libneuralnetworks.so
Loaded model ./mobilenet_quant_v1_224.tflite
resolved reporter
tensors size: 89
nodes size: 31
inputs: 1
input(0) name: Placeholder
0: MobilenetV1/Logits/AvgPool_1a/AvgPool, 1024, 3, 0.0235285, 0
1: MobilenetV1/Logits/Conv2d_1c_1x1/BiasAdd, 1001, 3, 0.165351, 74
2: MobilenetV1/Logits/Conv2d_1c_1x1/Conv2D_bias, 4004, 2, 0.000116509, 0
3: MobilenetV1/Logits/Conv2d_1c_1x1/weights_quant/FakeQuantWithMinMaxVars, 1025024, 3, 0.00495183, 67
4: MobilenetV1/MobilenetV1/Conv2d_0/Conv2D_Fold_bias, 128, 2, 0.000161006, 0
5: MobilenetV1/MobilenetV1/Conv2d_0/Relu6, 401408, 3, 0.0235285, 0
6: MobilenetV1/MobilenetV1/Conv2d_0/weights_quant/FakeQuantWithMinMaxVars, 864, 3, 0.0410565, 108
7: MobilenetV1/MobilenetV1/Conv2d_10_depthwise/Relu6, 100352, 3, 0.0235285, 0
8: MobilenetV1/MobilenetV1/Conv2d_10_depthwise/depthwise_Fold_bias, 2048, 2, 0.00039105, 0
9: MobilenetV1/MobilenetV1/Conv2d_10_depthwise/weights_quant/FakeQuantWithMinMaxVars, 4608, 3, 0.0166203, 131
10: MobilenetV1/MobilenetV1/Conv2d_10_pointwise/Conv2D_Fold_bias, 2048, 2, 0.000189115, 0
11: MobilenetV1/MobilenetV1/Conv2d_10_pointwise/Relu6, 100352, 3, 0.0235285, 0
12: MobilenetV1/MobilenetV1/Conv2d_10_pointwise/weights_quant/FakeQuantWithMinMaxVars, 262144, 3, 0.00803769, 148
13: MobilenetV1/MobilenetV1/Conv2d_11_depthwise/Relu6, 100352, 3, 0.0235285, 0
14: MobilenetV1/MobilenetV1/Conv2d_11_depthwise/depthwise_Fold_bias, 2048, 2, 0.000332007, 0
15: MobilenetV1/MobilenetV1/Conv2d_11_depthwise/weights_quant/FakeQuantWithMinMaxVars, 4608, 3, 0.0141109, 123
16: MobilenetV1/MobilenetV1/Conv2d_11_pointwise/Conv2D_Fold_bias, 2048, 2, 0.000261272, 0
17: MobilenetV1/MobilenetV1/Conv2d_11_pointwise/Relu6, 100352, 3, 0.0235285, 0
18: MobilenetV1/MobilenetV1/Conv2d_11_pointwise/weights_quant/FakeQuantWithMinMaxVars, 262144, 3, 0.0111045, 115
19: MobilenetV1/MobilenetV1/Conv2d_12_depthwise/Relu6, 25088, 3, 0.0235285, 0
20: MobilenetV1/MobilenetV1/Conv2d_12_depthwise/depthwise_Fold_bias, 2048, 2, 0.00012358, 0
21: MobilenetV1/MobilenetV1/Conv2d_12_depthwise/weights_quant/FakeQuantWithMinMaxVars, 4608, 3, 0.00525234, 117
22: MobilenetV1/MobilenetV1/Conv2d_12_pointwise/Conv2D_Fold_bias, 4096, 2, 0.000463319, 0
23: MobilenetV1/MobilenetV1/Conv2d_12_pointwise/Relu6, 50176, 3, 0.0235285, 0
24: MobilenetV1/MobilenetV1/Conv2d_12_pointwise/weights_quant/FakeQuantWithMinMaxVars, 524288, 3, 0.0196918, 144
25: MobilenetV1/MobilenetV1/Conv2d_13_depthwise/Relu6, 50176, 3, 0.0235285, 0
26: MobilenetV1/MobilenetV1/Conv2d_13_depthwise/depthwise_Fold_bias, 4096, 2, 0.00128296, 0
27: MobilenetV1/MobilenetV1/Conv2d_13_depthwise/weights_quant/FakeQuantWithMinMaxVars, 9216, 3, 0.0545281, 211
28: MobilenetV1/MobilenetV1/Conv2d_13_pointwise/Conv2D_Fold_bias, 4096, 2, 0.000587459, 0
29: MobilenetV1/MobilenetV1/Conv2d_13_pointwise/Relu6, 50176, 3, 0.0235285, 0
30: MobilenetV1/MobilenetV1/Conv2d_13_pointwise/weights_quant/FakeQuantWithMinMaxVars, 1048576, 3, 0.024968, 140
31: MobilenetV1/MobilenetV1/Conv2d_1_depthwise/Relu6, 401408, 3, 0.0235285, 0
32: MobilenetV1/MobilenetV1/Conv2d_1_depthwise/depthwise_Fold_bias, 128, 2, 0.0135622, 0
33: MobilenetV1/MobilenetV1/Conv2d_1_depthwise/weights_quant/FakeQuantWithMinMaxVars, 288, 3, 0.576417, 53
34: MobilenetV1/MobilenetV1/Conv2d_1_pointwise/Conv2D_Fold_bias, 256, 2, 0.000240194, 0
35: MobilenetV1/MobilenetV1/Conv2d_1_pointwise/Relu6, 802816, 3, 0.0235285, 0
36: MobilenetV1/MobilenetV1/Conv2d_1_pointwise/weights_quant/FakeQuantWithMinMaxVars, 2048, 3, 0.0102087, 101
37: MobilenetV1/MobilenetV1/Conv2d_2_depthwise/Relu6, 200704, 3, 0.0235285, 0
38: MobilenetV1/MobilenetV1/Conv2d_2_depthwise/depthwise_Fold_bias, 256, 2, 0.00194196, 0
39: MobilenetV1/MobilenetV1/Conv2d_2_depthwise/weights_quant/FakeQuantWithMinMaxVars, 576, 3, 0.0825367, 46
40: MobilenetV1/MobilenetV1/Conv2d_2_pointwise/Conv2D_Fold_bias, 512, 2, 0.000395467, 0
41: MobilenetV1/MobilenetV1/Conv2d_2_pointwise/Relu6, 401408, 3, 0.0235285, 0
42: MobilenetV1/MobilenetV1/Conv2d_2_pointwise/weights_quant/FakeQuantWithMinMaxVars, 8192, 3, 0.016808, 118
43: MobilenetV1/MobilenetV1/Conv2d_3_depthwise/Relu6, 401408, 3, 0.0235285, 0
44: MobilenetV1/MobilenetV1/Conv2d_3_depthwise/depthwise_Fold_bias, 512, 2, 0.000966625, 0
45: MobilenetV1/MobilenetV1/Conv2d_3_depthwise/weights_quant/FakeQuantWithMinMaxVars, 1152, 3, 0.0410832, 109
46: MobilenetV1/MobilenetV1/Conv2d_3_pointwise/Conv2D_Fold_bias, 512, 2, 0.000266758, 0
47: MobilenetV1/MobilenetV1/Conv2d_3_pointwise/Relu6, 401408, 3, 0.0235285, 0
48: MobilenetV1/MobilenetV1/Conv2d_3_pointwise/weights_quant/FakeQuantWithMinMaxVars, 16384, 3, 0.0113377, 110
49: MobilenetV1/MobilenetV1/Conv2d_4_depthwise/Relu6, 100352, 3, 0.0235285, 0
50: MobilenetV1/MobilenetV1/Conv2d_4_depthwise/depthwise_Fold_bias, 512, 2, 0.000243408, 0
51: MobilenetV1/MobilenetV1/Conv2d_4_depthwise/weights_quant/FakeQuantWithMinMaxVars, 1152, 3, 0.0103453, 137
52: MobilenetV1/MobilenetV1/Conv2d_4_pointwise/Conv2D_Fold_bias, 1024, 2, 0.000325615, 0
53: MobilenetV1/MobilenetV1/Conv2d_4_pointwise/Relu6, 200704, 3, 0.0235285, 0
54: MobilenetV1/MobilenetV1/Conv2d_4_pointwise/weights_quant/FakeQuantWithMinMaxVars, 32768, 3, 0.0138392, 129
55: MobilenetV1/MobilenetV1/Conv2d_5_depthwise/Relu6, 200704, 3, 0.0235285, 0
56: MobilenetV1/MobilenetV1/Conv2d_5_depthwise/depthwise_Fold_bias, 1024, 2, 0.000743922, 0
57: MobilenetV1/MobilenetV1/Conv2d_5_depthwise/weights_quant/FakeQuantWithMinMaxVars, 2304, 3, 0.031618, 77
58: MobilenetV1/MobilenetV1/Conv2d_5_pointwise/Conv2D_Fold_bias, 1024, 2, 0.000189554, 0
59: MobilenetV1/MobilenetV1/Conv2d_5_pointwise/Relu6, 200704, 3, 0.0235285, 0
60: MobilenetV1/MobilenetV1/Conv2d_5_pointwise/weights_quant/FakeQuantWithMinMaxVars, 65536, 3, 0.00805637, 127
61: MobilenetV1/MobilenetV1/Conv2d_6_depthwise/Relu6, 50176, 3, 0.0235285, 0
62: MobilenetV1/MobilenetV1/Conv2d_6_depthwise/depthwise_Fold_bias, 1024, 2, 0.000221356, 0
63: MobilenetV1/MobilenetV1/Conv2d_6_depthwise/weights_quant/FakeQuantWithMinMaxVars, 2304, 3, 0.00940801, 123
64: MobilenetV1/MobilenetV1/Conv2d_6_pointwise/Conv2D_Fold_bias, 2048, 2, 0.0002464, 0
65: MobilenetV1/MobilenetV1/Conv2d_6_pointwise/Relu6, 100352, 3, 0.0235285, 0
66: MobilenetV1/MobilenetV1/Conv2d_6_pointwise/weights_quant/FakeQuantWithMinMaxVars, 131072, 3, 0.0104724, 126
67: MobilenetV1/MobilenetV1/Conv2d_7_depthwise/Relu6, 100352, 3, 0.0235285, 0
68: MobilenetV1/MobilenetV1/Conv2d_7_depthwise/depthwise_Fold_bias, 2048, 2, 0.000485006, 0
69: MobilenetV1/MobilenetV1/Conv2d_7_depthwise/weights_quant/FakeQuantWithMinMaxVars, 4608, 3, 0.0206136, 129
70: MobilenetV1/MobilenetV1/Conv2d_7_pointwise/Conv2D_Fold_bias, 2048, 2, 0.00019147, 0
71: MobilenetV1/MobilenetV1/Conv2d_7_pointwise/Relu6, 100352, 3, 0.0235285, 0
72: MobilenetV1/MobilenetV1/Conv2d_7_pointwise/weights_quant/FakeQuantWithMinMaxVars, 262144, 3, 0.0081378, 115
73: MobilenetV1/MobilenetV1/Conv2d_8_depthwise/Relu6, 100352, 3, 0.0235285, 0
74: MobilenetV1/MobilenetV1/Conv2d_8_depthwise/depthwise_Fold_bias, 2048, 2, 0.000389983, 0
75: MobilenetV1/MobilenetV1/Conv2d_8_depthwise/weights_quant/FakeQuantWithMinMaxVars, 4608, 3, 0.0165749, 115
76: MobilenetV1/MobilenetV1/Conv2d_8_pointwise/Conv2D_Fold_bias, 2048, 2, 0.000251079, 0
77: MobilenetV1/MobilenetV1/Conv2d_8_pointwise/Relu6, 100352, 3, 0.0235285, 0
78: MobilenetV1/MobilenetV1/Conv2d_8_pointwise/weights_quant/FakeQuantWithMinMaxVars, 262144, 3, 0.0106713, 170
79: MobilenetV1/MobilenetV1/Conv2d_9_depthwise/Relu6, 100352, 3, 0.0235285, 0
80: MobilenetV1/MobilenetV1/Conv2d_9_depthwise/depthwise_Fold_bias, 2048, 2, 0.000351091, 0
81: MobilenetV1/MobilenetV1/Conv2d_9_depthwise/weights_quant/FakeQuantWithMinMaxVars, 4608, 3, 0.014922, 132
82: MobilenetV1/MobilenetV1/Conv2d_9_pointwise/Conv2D_Fold_bias, 2048, 2, 0.000161186, 0
83: MobilenetV1/MobilenetV1/Conv2d_9_pointwise/Relu6, 100352, 3, 0.0235285, 0
84: MobilenetV1/MobilenetV1/Conv2d_9_pointwise/weights_quant/FakeQuantWithMinMaxVars, 262144, 3, 0.00685069, 120
85: MobilenetV1/Predictions/Reshape, 1001, 3, 0.165351, 74
86: MobilenetV1/Predictions/Reshape/shape, 8, 2, 0, 0
87: MobilenetV1/Predictions/Softmax, 1001, 3, 0.00390625, 0
88: Placeholder, 150528, 3, 0.00392157, 0
len: 940650
width, height, channels: 517, 606, 3
input: 88
number of inputs: 1
number of outputs: 1
Segmentation fault (core dumped)