DARKFLOW-训练有素的Yolov2模型仅将json输出为[]

我正在运行Yolov2 DarkFlow。我从暗网下载了CFG和砝码。

我训练了2个单独的模型。

flow --model cfg/yolov2.cfg --load bin/yolov2.weights --train --annotation train/Annotations --dataset train/Images --lr 0.01 --gpu 1.0

平均损失从500步从256下降到6-7。

flow --model cfg/yolov2.cfg --trainer adam --train --annotation train/Annotations --dataset train/Images --lr 0.00146 --gpu 1.0

平均损失从250步降到256至5-6。

图像数据集包含300个图像,分为3组,每组100个。这些图像分别命名为“ None(number).jpg”,“ SafetyVest(number).jpg”和“ Helmet(number).jpg”。每个图像没有3个不同的带注释的标签,SafetyVest每个图像有1个带注释的标签,头盔每个图像有2个不同的带注释的标签。共有6个标签,每个标签大约有99到100个标签,以防止班级失衡。

当前,即使使用训练图像,我也无法测试图像。我已经尝试过这些方法。

flow --pbLoad built_graph/yolo.pb --metaLoad built_graph/yolo.meta --imgdir sample_img/

要做的就是简单地将相同的图像复制并粘贴到out文件夹中,而没有边界框。

flow --pbLoad built_graph/yolo.pb --metaLoad built_graph/yolo.meta --imgdir sample_img/ --json

这样做是向我输出了许多“ []”的json文件。

from darkflow.net.build import TFNet
import cv2

options = {
    'model': 'cfg/yolov2.cfg','load': 250,# 750 is the step number. Can be found in the ckpt folder
    'threshold': 0.05,# this number can be higher if the performance is better
    'gpu': 1.0                               # Dont use this if you have no gpu
}

tfnet = TFNet(options)

imgcv = cv2.imread("./sample_img/Helmet (2).jpg")
result = tfnet.return_predict(imgcv)
print(result)

类似地输出[]。我做错了什么吗?可能是我没有训练足够的步骤吗?我的图像名称有问题吗?在过去的一周中,我尝试纠正此问题,似乎许多人都遇到了与我相同的问题。感谢您的阅读,我们期待您的帮助。谢谢(:

kylezh 回答:DARKFLOW-训练有素的Yolov2模型仅将json输出为[]

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3168306.html

大家都在问