open-mmlab / mmtracking

OpenMMLab Video Perception Toolbox. It supports Video Object Detection (VID), Multiple Object Tracking (MOT), Single Object Tracking (SOT), Video Instance Segmentation (VIS) with a unified framework.
https://mmtracking.readthedocs.io/en/latest/
Apache License 2.0
3.57k stars 597 forks source link

ValueError: need at least one array to concatenate #108

Open ryanmaxwell96 opened 3 years ago

ryanmaxwell96 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

AzeroGYH commented 3 years ago

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.

OceanPang commented 3 years ago

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.

AtGrover commented 3 years ago

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

GT9505 commented 3 years ago

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

AtGrover commented 3 years ago

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)

lantudou commented 2 years ago

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 commented 2 years ago

@GT9505 Hi, Any updates for this issue?

lantudou commented 2 years ago

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

hammerAttack commented 2 years ago

thank you, : )

Bigfishering commented 2 years ago

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?

Dinghaoxuan commented 1 year ago

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.

hutIngk commented 4 days ago

so, here is my problem:i have tried all solution that mentioned above,such as add classes in config and "./mmtrack/datasets/imagenet_vid_dataset.py",but all these methods did not work,is there any wrong about my dataset or something else? here is my dataset structure: │ ├── mmtracking/data/mydata │ │ ├── Data │ │ │ ├── VID | │ │ │ ├── train | │ │ │ ├── val | │ │ │ ├── test │ │ ├── Annotations │ │ │ ├── VID | │ │ │ ├── train | │ │ │ │ ├──coco_vid_train.json | │ │ │ ├── val | │ │ │ │ ├──coco_vid_val.json both coco_vid_train.json and coco_vid_val.json follow the CocoVID style.

So, can anyone give me some advice?