InvalidArgumentError:维度必须相等,但对于输入形状为[?,?,?,5,2], [?,?,?,5,80]

2024-06-16 09:08:47 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试运行YOLO对象检测,所以我遵循了本教程

A Practical Guide to Object Detection using the Popular YOLO Framework – Part III (with Python codes)

我正在尝试运行代码,但是即使我的维度看起来是正确的,仍然会得到相同的维度错误。你知道吗

我是新的张量流,所以我不太清楚我做错了什么。你知道吗

我将公布代码和错误。你知道吗

img = plt.imread('./images/Elephant.jpg')#
image_shape = float(img.shape[0]), float(img.shape[1])
scores, boxes, classes = yolo_eval(yolo_outputs, image_shape)

我得到的错误如下-

InvalidArgumentError: Dimensions must be equal, but are 2 and 80 for 'mul_8' (op: 'Mul') with input shapes: [?,?,?,5,2], [?,?,?,5,80].

Tags: to对象代码imageimgobject错误with