I try to use the image.ImageDetIter according the docu. I fail to read the lst file properly even trying the example in the docu, i.e.,
1 2 5 480 640 3 0.05 0.16 0.75 0.9 data/xxx.jpg
I just replaced the imagepath and I get always a label mismatch.
Label shape (9,) inconsistent with annotation width 5.
Full error
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-67-f2a121b277b0> in <module>()
1 data_iter = mx.image.ImageDetIter(batch_size=2, data_shape=(3, 224, 224),
2 path_imglist='/Users/blattner/Desktop/bboxdir/test.lst',
----> 3 path_root='/Users/blattner/Desktop/bboxdir/data/')
/usr/local/lib/python3.6/site-packages/mxnet/image/detection.py in __init__(self, batch_size, data_shape, path_imgrec, path_imglist, path_root, path_imgidx, shuffle, part_index, num_parts, aug_list, imglist, data_name, label_name, **kwargs)
679
680 # went through all labels to get the proper label shape
--> 681 label_shape = self._estimate_label_shape()
682 self.provide_label = [(label_name, (self.batch_size, label_shape[0], label_shape[1]))]
683 self.label_shape = label_shape
/usr/local/lib/python3.6/site-packages/mxnet/image/detection.py in _estimate_label_shape(self)
700 while True:
701 label, _ = self.next_sample()
--> 702 label = self._parse_label(label)
703 max_count = max(max_count, label.shape[0])
704 except StopIteration:
/usr/local/lib/python3.6/site-packages/mxnet/image/detection.py in _parse_label(self, label)
725 msg = "Label shape %s inconsistent with annotation width %d." \
726 %(str(raw.shape), obj_width)
--> 727 raise RuntimeError(msg)
728 out = np.reshape(raw[header_width:], (-1, obj_width))
729 # remove bad ground-truths
RuntimeError: Label shape (9,) inconsistent with annotation width 5.
I checked the record format many times and it should be ok. Any idea?
Thx.