Как правильно заполнить параметры для преобразования tflite?
Вот сообщение об ошибке и информация о pb, как показано ниже,
(1) сообщение об ошибке
~/tensorflow/pkg/tensorflow$ bazel-bin/tensorflow/contrib/lite/toco/toco \
--input_format=TENSORFLOW_GRAPHDEF \
--input_file='retrained_graph.pb' \
--output_format=TFLITE \
--output_file='retrained_graph.tflite' \
--inference_type=FLOAT \
--inference_input_type=FLOAT \
--output_arrays=final_result \
--input_arrays=batch_size,phase_train \
--input_shapes=1,160,160,3:False \
--mean_values=128 \
--std_values=128
2018-09-06 17:16:14.249938: F tensorflow/contrib/lite/toco/model_cmdline_flags.cc:263] Check failed: mean_values.size() == model_flags->input_arrays_size()
(2) pb info
xxxx:~/tensorflow/pkg/tensorflow$ bazel-bin/tensorflow/tools/graph_transforms/summarize_graph --in_graph='zzz/retrained_graph.pb'
Found 2 possible inputs: (name=batch_size, type=int32(3), shape=<unknown>) (name=phase_train, type=bool(10), shape=<unknown>)
No variables spotted.
Found 1 possible outputs: (name=final_result, op=Softmax)
Found 23514555 (23.51M) const parameters, 0 (0) variable parameters, and 675 control_edges
Op types used: 2019 Switch, 1104 Const, 1057 Identity, 449 Sub, 449 Merge, 247 Mul, 224 FusedBatchNorm, 132 Conv2D, 131 Relu, 24 Add, 23 ConcatV2, 21 BiasAdd, 3 MaxPool, 3 Shape, 3 Reshape, 2 MatMul, 2 Placeholder, 1 PlaceholderWithDefault, 1 AvgPool, 1 StridedSlice, 1 Softmax, 1 RealDiv, 1 RandomUniform, 1 QueueDequeueUpToV2, 1 FIFOQueueV2, 1 Pack, 1 Floor
To use with tensorflow/tools/benchmark:benchmark_model try these arguments:
bazel run tensorflow/tools/benchmark:benchmark_model -- --graph=zzz/retrained_graph.pb --show_flops --input_layer=batch_size,phase_train --input_layer_type=int32,bool --input_layer_shape=: --output_layer=final_result