r3det-on-mmdetection icon indicating copy to clipboard operation
r3det-on-mmdetection copied to clipboard

ValueError: need at least one array to concatenate

Open why228430 opened this issue 4 years ago • 9 comments

when I run sh rtools/train.sh, I meet the problem .How I can do to solve the error!

Traceback (most recent call last): File "tools/train.py", line 161, in main() File "tools/train.py", line 157, in main meta=meta) File "/home/dl/anaconda3/lib/python3.7/site-packages/mmdet-2.1.0+unknown-py3.7-linux-x86_64.egg/mmdet/apis/train.py", line 179, in train_detector runner.run(data_loaders, cfg.workflow, cfg.total_epochs) File "/home/dl/anaconda3/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 122, in run epoch_runner(data_loaders[i], **kwargs) File "/home/dl/anaconda3/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 27, in train for i, data_batch in enumerate(data_loader): File "/home/dl/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 291, in iter return _MultiProcessingDataLoaderIter(self) File "/home/dl/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 764, in init self._try_put_index() File "/home/dl/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 994, in _try_put_index index = self._next_index() File "/home/dl/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 357, in _next_index return next(self._sampler_iter) # may raise StopIteration File "/home/dl/anaconda3/lib/python3.7/site-packages/torch/utils/data/sampler.py", line 208, in iter for idx in self.sampler: File "/home/dl/anaconda3/lib/python3.7/site-packages/mmdet-2.1.0+unknown-py3.7-linux-x86_64.egg/mmdet/datasets/samplers/group_sampler.py", line 36, in iter indices = np.concatenate(indices,0) ValueError: need at least one array to concatenate

why228430 avatar Sep 17 '20 12:09 why228430

have you solved that problem?

DingShengLin avatar Sep 27 '20 08:09 DingShengLin

change image path can solve this problem: data_root = ‘data/dota/’

DingShengLin avatar Sep 27 '20 08:09 DingShengLin

Thanks for your help! I have solved the problem.

why228430 avatar Sep 27 '20 10:09 why228430

Did you met the error? 2020-10-17 10:25:11,392 - mmdet - INFO - Saving checkpoint at 1 epochs completed: 0, elapsed: 0sTraceback (most recent call last): File "tools/train.py", line 161, in main() File "tools/train.py", line 157, in main meta=meta) File "/home/dl/anaconda3/lib/python3.7/site-packages/mmdet-2.1.0+8f3868f-py3.7-linux-x86_64.egg/mmdet/apis/train.py", line 179, in train_detector runner.run(data_loaders, cfg.workflow, cfg.total_epochs) File "/home/dl/anaconda3/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 122, in run epoch_runner(data_loaders[i], **kwargs) File "/home/dl/anaconda3/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 46, in train self.call_hook('after_train_epoch') File "/home/dl/anaconda3/lib/python3.7/site-packages/mmcv/runner/base_runner.py", line 282, in call_hook getattr(hook, fn_name)(self) File "/home/dl/anaconda3/lib/python3.7/site-packages/mmdet-2.1.0+8f3868f-py3.7-linux-x86_64.egg/mmdet/core/evaluation/eval_hooks.py", line 28, in after_train_epoch self.evaluate(runner, results) File "/home/dl/anaconda3/lib/python3.7/site-packages/mmdet-2.1.0+8f3868f-py3.7-linux-x86_64.egg/mmdet/core/evaluation/eval_hooks.py", line 32, in evaluate results, logger=runner.logger, **self.eval_kwargs) File "/home/dl/anaconda3/lib/python3.7/site-packages/mmdet-2.1.0+8f3868f-py3.7-linux-x86_64.egg/mmdet/datasets/dotav1.py", line 187, in evaluate logger=logger) File "/home/dl/anaconda3/lib/python3.7/site-packages/mmdet-2.1.0+8f3868f-py3.7-linux-x86_64.egg/mmdet/core/evaluation/rmean_ap.py", line 196, in reval_map num_classes = len(det_results[0]) # positive class num IndexError: list index out of range @DingShengLin

why228430 avatar Oct 17 '20 07:10 why228430

you should change the class

Miki-lin avatar Nov 01 '20 15:11 Miki-lin

you should change the class Which the file that i should change the class? thank you

houliping avatar Nov 02 '20 07:11 houliping

@Miki-lin @why228430 I have encountered with the same error,too.Could you give me some advice?

2020-10-17 10:25:11,392 - mmdet - INFO - Saving checkpoint at 1 epochs completed: 0, elapsed: 0sTraceback (most recent call last): File "tools/train.py", line 161, in main() File "tools/train.py", line 157, in main meta=meta) File "/home/dl/anaconda3/lib/python3.7/site-packages/mmdet-2.1.0+8f3868f-py3.7-linux-x86_64.egg/mmdet/apis/train.py", line 179, in train_detector runner.run(data_loaders, cfg.workflow, cfg.total_epochs) File "/home/dl/anaconda3/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 122, in run epoch_runner(data_loaders[i], **kwargs) File "/home/dl/anaconda3/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 46, in train self.call_hook('after_train_epoch') File "/home/dl/anaconda3/lib/python3.7/site-packages/mmcv/runner/base_runner.py", line 282, in call_hook getattr(hook, fn_name)(self) File "/home/dl/anaconda3/lib/python3.7/site-packages/mmdet-2.1.0+8f3868f-py3.7-linux-x86_64.egg/mmdet/core/evaluation/eval_hooks.py", line 28, in after_train_epoch self.evaluate(runner, results) File "/home/dl/anaconda3/lib/python3.7/site-packages/mmdet-2.1.0+8f3868f-py3.7-linux-x86_64.egg/mmdet/core/evaluation/eval_hooks.py", line 32, in evaluate results, logger=runner.logger, **self.eval_kwargs) File "/home/dl/anaconda3/lib/python3.7/site-packages/mmdet-2.1.0+8f3868f-py3.7-linux-x86_64.egg/mmdet/datasets/dotav1.py", line 187, in evaluate logger=logger) File "/home/dl/anaconda3/lib/python3.7/site-packages/mmdet-2.1.0+8f3868f-py3.7-linux-x86_64.egg/mmdet/core/evaluation/rmean_ap.py", line 196, in reval_map num_classes = len(det_results[0]) # positive class num IndexError: list index out of range

seacloud-0420 avatar Jan 20 '21 01:01 seacloud-0420

can you tell me the way to deal with this problem ,in detail,thanks!!!

ggzjg avatar Dec 21 '21 08:12 ggzjg

when I run sh rtools/train.sh, I meet the problem .How I can do to solve the error!

Traceback (most recent call last): File "tools/train.py", line 161, in main() File "tools/train.py", line 157, in main meta=meta) File "/home/dl/anaconda3/lib/python3.7/site-packages/mmdet-2.1.0+unknown-py3.7-linux-x86_64.egg/mmdet/apis/train.py", line 179, in train_detector runner.run(data_loaders, cfg.workflow, cfg.total_epochs) File "/home/dl/anaconda3/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 122, in run epoch_runner(data_loaders[i], **kwargs) File "/home/dl/anaconda3/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 27, in train for i, data_batch in enumerate(data_loader): File "/home/dl/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 291, in iter return _MultiProcessingDataLoaderIter(self) File "/home/dl/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 764, in init self._try_put_index() File "/home/dl/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 994, in _try_put_index index = self._next_index() File "/home/dl/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 357, in _next_index return next(self._sampler_iter) # may raise StopIteration File "/home/dl/anaconda3/lib/python3.7/site-packages/torch/utils/data/sampler.py", line 208, in iter for idx in self.sampler: File "/home/dl/anaconda3/lib/python3.7/site-packages/mmdet-2.1.0+unknown-py3.7-linux-x86_64.egg/mmdet/datasets/samplers/group_sampler.py", line 36, in iter indices = np.concatenate(indices,0) ValueError: need at least one array to concatenate

ggzjg avatar Dec 23 '21 06:12 ggzjg