Tensorflow 在coral board上使用非量化的deeplab模型

Tensorflow 在coral board上使用非量化的deeplab模型,tensorflow,google-coral,Tensorflow,Google Coral,我在coral开发板上使用了deeplab v3的量化模型。结果不是很精确,所以我想使用一个非量化的模型 我可以找到deeplab的tflite非量化模型,所以我想生成它。 我没有在Tensorflow github上加载异常65_coco_voc_trainval模型: 然后我使用该命令转换输入: bazel-bin/tensorflow/tools/graph_transforms/transform_graph \ --in_graph="/path/to/xception65_coco

我在coral开发板上使用了deeplab v3的量化模型。结果不是很精确,所以我想使用一个非量化的模型

我可以找到deeplab的tflite非量化模型,所以我想生成它。 我没有在Tensorflow github上加载异常65_coco_voc_trainval模型:

然后我使用该命令转换输入:

bazel-bin/tensorflow/tools/graph_transforms/transform_graph \
--in_graph="/path/to/xception65_coco_voc_trainval.pb" \
--out_graph="/path/to/xception65_coco_voc_trainval_flatten.pb" \
--inputs='ImageTensor' \
--outputs='SemanticPredictions' \
--transforms='
    strip_unused_nodes(type=quint8, shape="1,513,513,3")
    flatten_atrous_conv
    fold_constants(ignore_errors=true, clear_output_shapes=false)
    fold_batch_norms
    fold_old_batch_norms
    remove_device
    sort_by_execution_order
然后使用以下命令生成tflite文件:

tflite_convert \
  --graph_def_file="/tmp/deeplab_mobilenet_v2_opt_flatten_static.pb" \
  --output_file="/tmp/deeplab_mobilenet_v2_opt_flatten_static.tflite" \
  --output_format=TFLITE \
  --input_shape=1,513,513,3 \
  --input_arrays="ImageTensor" \
  --inference_type=FLOAT \
  --inference_input_type=QUANTIZED_UINT8 \
  --std_dev_values=128 \
  --mean_values=128 \
  --change_concat_input_ranges=true \
  --output_arrays="SemanticPredictions" \
  --allow_custom_ops
此命令生成一个tflite文件。我没有在我的coral开发板上加载该文件,并尝试使用运行它

我在github上使用该示例在coral上尝试我的deeplab模型:

启动程序时出现错误:

 terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Aborted
错误来自该行:

engine = BasicEngine(args.model)