https://github.com/DetectionTeamUCAS/FPN_Tensorflow
按说明设置自己的训练集后,进入tool/运行train.py后报错:
PaddingFIFOQueue '_1_get_batch/batch/padding_fifo_queue' is closed and has insufficient elements (requested 1, current size 0)
查了一下,应该是xml文件中box坐标范围导致的。修改data/io/convert_data/io/convert_to_tfrecord.py中line68为
gtbox_label = np.array(box_list, dtype=np.int32) # [x1, y1. x2, y2, label]
xmin, ymin, xmax, ymax, label = gtbox_label[:, 0], gtbox_label[:, 1], gtbox_label[:, 2],\
gtbox_label[:, 3], gtbox_label[:, 4]
xmin = np.where(xmin <= 0, 1, xmin)
ymin = np.where(ymin <= 0, 1, ymin)
xmax = np.where(xmax >= img_width, img_width-1, xmax)
ymax = np.where(ymax >= img_height, img_height-1, ymax)
# [ymin, xmin, ymax, xmax, label]
gtbox_label = np.transpose(np.stack([ymin, xmin, ymax, xmax, label], axis=0))
即可。
按说明设置自己的训练集后,进入tool/运行train.py后报错:
PaddingFIFOQueue '_1_get_batch/batch/padding_fifo_queue' is closed and has insufficient elements (requested 1, current size 0)
查了一下,应该是xml文件中box坐标范围导致的。修改data/io/convert_data/io/convert_to_tfrecord.py中line68为
gtbox_label = np.array(box_list, dtype=np.int32) # [x1, y1. x2, y2, label]
xmin, ymin, xmax, ymax, label = gtbox_label[:, 0], gtbox_label[:, 1], gtbox_label[:, 2],\
gtbox_label[:, 3], gtbox_label[:, 4]
xmin = np.where(xmin <= 0, 1, xmin)
ymin = np.where(ymin <= 0, 1, ymin)
xmax = np.where(xmax >= img_width, img_width-1, xmax)
ymax = np.where(ymax >= img_height, img_height-1, ymax)
# [ymin, xmin, ymax, xmax, label]
gtbox_label = np.transpose(np.stack([ymin, xmin, ymax, xmax, label], axis=0))
即可。
没有评论:
发表评论