Tensorflow目标检测-Yolo v3模型学习

Tensorflow目标检测-Yolo v3模型学习

鉴于Tensorflow官方object detection 训练的fruit,检测效果差(目前还没找到实质原因),从网上找了Yolo-v3模型目标检测。学习Kaggle的《Yolo v3 Object Detection in Tensorflow》,按照github上的指引学习测试即可。如有侵权,请告知删除。

1. 调试detection程序报错

在跑detection.py程序时,报如下错误:

The Conv2D op currently only supports the NHWC tensor format on the CPU. The op was given the format: NCHW

度娘是这样解决的:detection.py中,在Yolo_v3类参数中,加入data_format= ‘channels_last’ 即可。

model = Yolo_v3(n_classes=n_classes, model_size=_MODEL_SIZE,
                max_output_size=max_output_size,
                iou_threshold=iou_threshold,
                confidence_threshold=confidence_threshold)

改为:

model = Yolo_v3(n_classes=n_classes, model_size=_MODEL_SIZE,
                max_output_size=_MAX_OUTPUT_SIZE,
                iou_threshold=iou_threshold,
                confidence_threshold=confidence_threshold,
                data_format= 'channels_last')

2. 使用自己的fruit图片验证

测试结果如下,比自己训练(ssd_mobilenet_v1_coco)测试的效果好百倍。
在这里插入图片描述
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/duanyuwangyuyan/article/details/112913471