【问题标题】:.tflite model initializing the same detection boxes everytime.tflite 模型每次都初始化相同的检测框
【发布时间】:2019-09-17 18:29:12
【问题描述】:

我正在尝试在连接到谷歌开发板的 USB 网络摄像头上实现一个从头开始训练的模型。我在 15k 时减少了训练。该模型在 15k 时尚未完全收敛,但我想锻炼如何冻结图形、tflite 并将其移动到谷歌珊瑚开发板上。我意识到这可能是准确性方面的问题。 MobileNetv2。

下面是天花板和桌子。无论相机在看什么,检测框每次都出现在完全相同的位置。当相机移动时,框不会移动,百分比也不会改变。

训练模型

python train.py --logtostderr --train_dir=training --pipeline_config_path=training/ssd_mobilenet_v1_coco.config

冻结模型

python export_tflite_ssd_graph.py --pipeline_config_path=training/ssd_mobilenet_v2_coco.config --trained_checkpoint_prefix=training/model.ckpt-9070 --output_directory=inference_graph --add_postprocessing_op=true 

量化

tflite_convert --graph_def_file=inference_graph/tflite_graph.pb --output_file=inference_graph/detect.tflite --inference_type=QUANTIZED_UINT8 --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 --mean_values=128 --std_dev_values=127 --allow_custom_ops --default_ranges_min=0 --default_ranges_max=6

模型在谷歌珊瑚开发板上运行如下;

export DISPLAY=:0 && edgetpu_detect \
--source /dev/video1:YUY2:1280x720:20/1  \
--model ${DEMO_FILES}/converted_tflite_quant_model.tflite

谷歌珊瑚预装了一个演示面部识别模型(下图)。唯一的区别是型号。下面的命令完美运行,并在屏幕上跟踪我的脸。上面的命令会产生下面的照片。

export DISPLAY=:0 && edgetpu_detect \
--source /dev/video1:YUY2:1280x720:20/1  \
--model ${DEMO_FILES}/mobilenet_ssd_v2_face_quant_postprocess_edgetpu.tflite

这里可能出了什么问题?

编辑,几个月后,我用 mobilenet_v1 重新训练它,得到完全相同的结果。

【问题讨论】:

    标签: tensorflow machine-learning computer-vision google-coral


    【解决方案1】:

    嗯,我想知道源相机是否也有问题? 您能否再次检查像素格式、大小和 FPS 值是否正确? 此外,在您发布的两张图片上,该过程似乎正在加载您的converted_tflite_quant_model.tflite 模型,您确定您尝试过其他模型吗? 您是否能够以正确的结果运行演示?

    【讨论】:

    • 相机看起来不错,v4l2-ctl --list-formats-ext --device /dev/video1 输出正确
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-27
    • 1970-01-01
    • 2014-05-09
    • 2018-11-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多