mmtracking icon indicating copy to clipboard operation
mmtracking copied to clipboard

ValueError: need at least one array to concatenate

Open ryanmaxwell96 opened this issue 4 years ago • 14 comments

I have followed all instructions. And I'm getting this error when I try to run

python tools/train.py configs/mot/deepsort/deepsort_faster-rcnn_fpn_4e_mot17-public-half.py

Traceback (most recent call last): File "tools/train.py", line 168, in <module> main() File "tools/train.py", line 164, in main meta=meta) File "/home/maxwelr/mmtracking/mmtrack/apis/train.py", line 136, in train_model runner.run(data_loaders, cfg.workflow, cfg.total_epochs) File "/home/maxwelr/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 125, in run epoch_runner(data_loaders[i], **kwargs) File "/home/maxwelr/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 47, in train for i, data_batch in enumerate(self.data_loader): File "/home/maxwelr/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 291, in __iter__ return _MultiProcessingDataLoaderIter(self) File "/home/maxwelr/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 764, in __init__ self._try_put_index() File "/home/maxwelr/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 994, in _try_put_index index = self._next_index() File "/home/maxwelr/anaconda3/envs/open-mmlab/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/maxwelr/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/utils/data/sampler.py", line 208, in __iter__ for idx in self.sampler: File "/home/maxwelr/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/mmdet/datasets/samplers/group_sampler.py", line 36, in __iter__ indices = np.concatenate(indices) File "<__array_function__ internals>", line 6, in concatenate ValueError: need at least one array to concatenate

ryanmaxwell96 avatar Feb 16 '21 06:02 ryanmaxwell96

I'm not sure what I did, but now I am also getting the error:

Traceback (most recent call last): File "tools/train.py", line 168, in <module> main() File "tools/train.py", line 164, in main meta=meta) File "/home/maxwelr/mmtracking/mmtrack/apis/train.py", line 136, in train_model runner.run(data_loaders, cfg.workflow, cfg.total_epochs) File "/home/maxwelr/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 125, in run epoch_runner(data_loaders[i], **kwargs) File "/home/maxwelr/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 47, in train for i, data_batch in enumerate(self.data_loader): File "/home/maxwelr/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 291, in __iter__ return _MultiProcessingDataLoaderIter(self) File "/home/maxwelr/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 764, in __init__ self._try_put_index() File "/home/maxwelr/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 994, in _try_put_index index = self._next_index() File "/home/maxwelr/anaconda3/envs/open-mmlab/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/maxwelr/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/utils/data/sampler.py", line 208, in __iter__ for idx in self.sampler: File "/home/maxwelr/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/mmdet/datasets/samplers/group_sampler.py", line 36, in __iter__ indices = np.concatenate(indices) File "<__array_function__ internals>", line 6, in concatenate ValueError: need at least one array to concatenate Error in atexit._run_exitfuncs: Traceback (most recent call last): File "/home/maxwelr/anaconda3/envs/open-mmlab/lib/python3.7/multiprocessing/popen_fork.py", line 28, in poll pid, sts = os.waitpid(self.pid, flag) File "/home/maxwelr/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/utils/data/_utils/signal_handling.py", line 66, in handler _error_if_any_worker_fails() RuntimeError: DataLoader worker (pid 32599) is killed by signal: Terminated.

ryanmaxwell96 avatar Feb 17 '21 06:02 ryanmaxwell96

I believe this is still related to the first issue I showed though:

line 6, in concatenate ValueError: need at least one array to concatenate Error in atexit._run_exitfuncs

ryanmaxwell96 avatar Feb 17 '21 06:02 ryanmaxwell96

I have followed all instructions. And I'm getting this error when I try to run

python tools/train.py configs/mot/deepsort/deepsort_faster-rcnn_fpn_4e_mot17-public-half.py

Traceback (most recent call last): File "tools/train.py", line 168, in <module> main() File "tools/train.py", line 164, in main meta=meta) File "/home/maxwelr/mmtracking/mmtrack/apis/train.py", line 136, in train_model runner.run(data_loaders, cfg.workflow, cfg.total_epochs) File "/home/maxwelr/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 125, in run epoch_runner(data_loaders[i], **kwargs) File "/home/maxwelr/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 47, in train for i, data_batch in enumerate(self.data_loader): File "/home/maxwelr/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 291, in __iter__ return _MultiProcessingDataLoaderIter(self) File "/home/maxwelr/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 764, in __init__ self._try_put_index() File "/home/maxwelr/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 994, in _try_put_index index = self._next_index() File "/home/maxwelr/anaconda3/envs/open-mmlab/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/maxwelr/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/utils/data/sampler.py", line 208, in __iter__ for idx in self.sampler: File "/home/maxwelr/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/mmdet/datasets/samplers/group_sampler.py", line 36, in __iter__ indices = np.concatenate(indices) File "<__array_function__ internals>", line 6, in concatenate ValueError: need at least one array to concatenate

Hi, do you have solved this issue? I get the same issue and have no idea about it.

AzeroGYH avatar Feb 23 '21 14:02 AzeroGYH

Hi all, please read the README.md

As these trackers are using offline trained detectors, you need to train the detector first and infer with the MOT model.

OceanPang avatar Feb 24 '21 14:02 OceanPang

According to my assumption, VID does not require already trained detector as the task is training a detector itself but not sure why I am getting this error for VID with SELSA or any other architecture @OceanPang

AtGrover avatar Jul 01 '21 18:07 AtGrover

@AtGrover Hi, what command did you run? Could you give the error information of SELSA?

GT9505 avatar Jul 02 '21 09:07 GT9505

Running with python tools/train.py config/vid/$SELSA_CONFIG Base config in selsa default config is changed to the new dataset (i.e. CocoVID)

AtGrover avatar Jul 02 '21 13:07 AtGrover

Same question, Using the SELSA config file for the customized dataset will cause this error. It seems like the training dataloader cannot find the image path

lantudou avatar Dec 14 '21 02:12 lantudou

@GT9505 Hi, Any updates for this issue?

lantudou avatar Dec 14 '21 02:12 lantudou

Well, I find the solution, In the config file, you need to set the classes as the same as the categories in your annotation json file. If not, the mmtrack will ignore all data and cause this error

lantudou avatar Dec 14 '21 03:12 lantudou

thank you, : )

hammerAttack avatar Jan 08 '22 12:01 hammerAttack

hi,thouth i have changed the classess and the num_class,but i still met the same problem,could i get your email and ask for u?

Bigfishering avatar Nov 17 '22 07:11 Bigfishering

hi,thouth i have changed the classess and the num_class,but i still met the same problem,could i get your email and ask for u?

The classes in "./mmtrack/datasets/imagenet_vid_dataset.py" should also be changed.

Dinghaoxuan avatar Apr 06 '23 05:04 Dinghaoxuan