Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: need at least one array to stack #242

Open
lovewangwenfly opened this issue Sep 10, 2021 · 3 comments
Open

ValueError: need at least one array to stack #242

lovewangwenfly opened this issue Sep 10, 2021 · 3 comments

Comments

@lovewangwenfly
Copy link

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

@lovewangwenfly
Copy link
Author

where can modify?

@fxyp
Copy link

fxyp commented Aug 28, 2022

same question. It could be an error caused by the dataset. How did you solve it?

@gladdduck
Copy link

it has been temporarily fixed issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants