Tensorflow对象检测:运行eval.py时发生Box数据错误

问题描述 投票:0回答:1

ValueError:无效的框数据。数据必须是N [y_min,x_min,y_max,x_max]的numpy数组。

我正在使用extraneous code从csv文件创建tfrecord(谷歌表示这是唯一的方法),这是坐标正确的部分:

for index, row in group.object.iterrows():
    ymins.append(row['ymin'] / width)
    xmins.append(row['xmin'] / width)
    ymaxs.append(row['ymax'] / height)
    xmaxs.append(row['xmax'] / height)
    classes_text.append(row['class'].encode('utf8'))
    classes.append(class_text_to_int(row['class']))

tf_example = tf.train.Example(features=tf.train.Features(feature={
    'image/height': dataset_util.int64_feature(height),
    'image/width': dataset_util.int64_feature(width),
    'image/filename': dataset_util.bytes_feature(filename),
    'image/source_id': dataset_util.bytes_feature(filename),
    'image/encoded': dataset_util.bytes_feature(encoded_jpg),
    'image/format': dataset_util.bytes_feature(image_format),
    'image/object/bbox/ymin': dataset_util.float_list_feature(ymins),
    'image/object/bbox/xmin': dataset_util.float_list_feature(xmins),
    'image/object/bbox/ymax': dataset_util.float_list_feature(ymaxs),
    'image/object/bbox/xmax': dataset_util.float_list_feature(xmaxs),
    'image/object/class/text': dataset_util.bytes_list_feature(classes_text),
    'image/object/class/label': dataset_util.int64_list_feature(classes)

我做错了什么?所有的tf对象检测教程都使用了浣熊检测器中的generate_tfrecord.py。我在github上找到了一个可以按正确顺序放置坐标的助手,但是根本没有帮助我(上面给出了代码)。

python tensorflow object-detection object-detection-api
1个回答
0
投票
您知道这个问题了吗?我正面临着同样的问题。我已经如上所述更新了generate_tfrecord.py代码,但还是没有运气。

谢谢

© www.soinside.com 2019 - 2024. All rights reserved.