when i train my own datasets it occurs: ValueError: need at least one array to stack
327it [01:31, 3.57it/s]
Traceback (most recent call last):
File "H:/wangwenjingyolov/simple-faster-rcnn-pytorch-master/train.py", line 130, in
fire.Fire()
File "H:\wangwenjingyolov\simple-faster-rcnn-pytorch-master\venv\lib\site-packages\fire\core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "H:\wangwenjingyolov\simple-faster-rcnn-pytorch-master\venv\lib\site-packages\fire\core.py", line 471, in _Fire
target=component.name)
File "H:\wangwenjingyolov\simple-faster-rcnn-pytorch-master\venv\lib\site-packages\fire\core.py", line 681, in CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "H:/wangwenjingyolov/simple-faster-rcnn-pytorch-master/train.py", line 76, in train
for ii, (img, bbox, label_, scale) in tqdm(enumerate(dataloader)):
File "H:\wangwenjingyolov\simple-faster-rcnn-pytorch-master\venv\lib\site-packages\tqdm\std.py", line 1185, in iter
for obj in iterable:
File "H:\wangwenjingyolov\simple-faster-rcnn-pytorch-master\venv\lib\site-packages\torch\utils\data\dataloader.py", line 345, in next
data = self._next_data()
File "H:\wangwenjingyolov\simple-faster-rcnn-pytorch-master\venv\lib\site-packages\torch\utils\data\dataloader.py", line 385, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "H:\wangwenjingyolov\simple-faster-rcnn-pytorch-master\venv\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "H:\wangwenjingyolov\simple-faster-rcnn-pytorch-master\venv\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "H:\wangwenjingyolov\simple-faster-rcnn-pytorch-master\data\dataset.py", line 107, in getitem
ori_img, bbox, label, difficult = self.db.get_example(idx)
File "H:\wangwenjingyolov\simple-faster-rcnn-pytorch-master\data\voc_dataset.py", line 131, in get_example
bbox = np.stack(bbox).astype(np.float32)
File "<__array_function__ internals>", line 6, in stack
File "H:\wangwenjingyolov\simple-faster-rcnn-pytorch-master\venv\lib\site-packages\numpy\core\shape_base.py", line 423, in stack
raise ValueError('need at least one array to stack')
ValueError: need at least one array to stack
when i train my own datasets it occurs: ValueError: need at least one array to stack 327it [01:31, 3.57it/s] Traceback (most recent call last): File "H:/wangwenjingyolov/simple-faster-rcnn-pytorch-master/train.py", line 130, in
fire.Fire()
File "H:\wangwenjingyolov\simple-faster-rcnn-pytorch-master\venv\lib\site-packages\fire\core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "H:\wangwenjingyolov\simple-faster-rcnn-pytorch-master\venv\lib\site-packages\fire\core.py", line 471, in _Fire
target=component.name)
File "H:\wangwenjingyolov\simple-faster-rcnn-pytorch-master\venv\lib\site-packages\fire\core.py", line 681, in CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "H:/wangwenjingyolov/simple-faster-rcnn-pytorch-master/train.py", line 76, in train
for ii, (img, bbox, label_, scale) in tqdm(enumerate(dataloader)):
File "H:\wangwenjingyolov\simple-faster-rcnn-pytorch-master\venv\lib\site-packages\tqdm\std.py", line 1185, in iter
for obj in iterable:
File "H:\wangwenjingyolov\simple-faster-rcnn-pytorch-master\venv\lib\site-packages\torch\utils\data\dataloader.py", line 345, in next
data = self._next_data()
File "H:\wangwenjingyolov\simple-faster-rcnn-pytorch-master\venv\lib\site-packages\torch\utils\data\dataloader.py", line 385, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "H:\wangwenjingyolov\simple-faster-rcnn-pytorch-master\venv\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "H:\wangwenjingyolov\simple-faster-rcnn-pytorch-master\venv\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "H:\wangwenjingyolov\simple-faster-rcnn-pytorch-master\data\dataset.py", line 107, in getitem
ori_img, bbox, label, difficult = self.db.get_example(idx)
File "H:\wangwenjingyolov\simple-faster-rcnn-pytorch-master\data\voc_dataset.py", line 131, in get_example
bbox = np.stack(bbox).astype(np.float32)
File "<__array_function__ internals>", line 6, in stack
File "H:\wangwenjingyolov\simple-faster-rcnn-pytorch-master\venv\lib\site-packages\numpy\core\shape_base.py", line 423, in stack
raise ValueError('need at least one array to stack')
ValueError: need at least one array to stack
Process finished with exit code 1