You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 20.04中tflite_convert命令未找到,如何获取该工具?

解决「tflite_convert command not found」问题(TensorFlow 1.15)

针对TensorFlow 1.15版本,你可以通过以下方式获取并调用tflite_convert工具:

  • 直接通过Python模块调用(推荐)
    TensorFlow 1.15中,tflite_convert是内置模块,无需单独安装,直接用Python解释器调用即可。将你原命令修改为如下形式:

    python -m tensorflow.lite.tflite_convert \
    --input_file=$OUTPUT_DIR/tflite_graph.pb \
    --output_file=$OUTPUT_DIR/detect.tflite \
    --input_shapes=1,300,300,3 \
    --input_arrays=normalized_input_image_tensor \
    --output_arrays='TFLite_Detection_PostProcess','TFLite_Detection_PostProcess:1','TFLite_Detection_PostProcess:2','TFLite_Detection_PostProcess:3' \
    --inference_type=QUANTIZED_UINT8 \
    --mean_values=128 \
    --std_values=128 \
    --change_concat_input_ranges=false \
    --allow_custom_ops
    

    这种方式无需依赖系统PATH配置,只要Python环境正确安装了TensorFlow 1.15就能运行。

  • 检查安装并配置PATH

    1. 执行pip show tensorflow确认版本为1.15,若版本不符,重新安装:pip install tensorflow==1.15
    2. 找到tflite_convert脚本位置:通常在Python环境的site-packages/tensorflow/lite/tools/目录下
    3. 将该目录加入系统PATH,或直接用绝对路径调用脚本:
      /path/to/your/python/env/site-packages/tensorflow/lite/tools/tflite_convert \
      # 后续添加你的参数
      

内容的提问来源于stack exchange,提问作者Matt Ciuzel

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.18 00:25:24