加载预训练的yolov4小砝码时出错

问题描述

我正在尝试使用YOlov4-tiny创建对象检测器,并且从下面的链接中获得了权重和cfg文件

当我加载权重时,出现以下运行时错误

RuntimeError:形状'[256、384、3、3]'对于大小为756735的输入无效

enter image description here

我的代码

config_path='yolov4-tiny.cfg'
weights_path='yolov4-tiny.weights'
class_path='coco.names'
img_size=416
conf_thres=0.8 #confidence threshold
nms_thres=0.4 #non max suppression thresh

model=Darknet(config_path,img_size=img_size)
model.load_weights(weights_path)
model.cuda()
model.eval()
classes=utils.load_classes(class_path)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)