tianzhi0549 / FCOS

FCOS: Fully Convolutional One-Stage Object Detection (ICCV'19)
https://arxiv.org/abs/1904.01355
Other
3.28k stars 630 forks source link

ValueError: num_samples should be a positive integeral value, but got num_samples=0 #43

Closed qianzhang2018 closed 5 years ago

qianzhang2018 commented 5 years ago

Traceback (most recent call last): File "tools/train_net.py", line 175, in main() File "tools/train_net.py", line 168, in main model = train(cfg, args.local_rank, args.distributed) File "tools/train_net.py", line 61, in train start_iter=arguments["iteration"], File "/home/administrator/USPIntern/zq/FCOS/maskrcnn_benchmark/data/build.py", line 158, in make_data_loader sampler = make_data_sampler(dataset, shuffle, is_distributed) File "/home/administrator/USPIntern/zq/FCOS/maskrcnn_benchmark/data/build.py", line 63, in make_data_sampler sampler = torch.utils.data.sampler.RandomSampler(dataset) File "/home/administrator/.local/lib/python3.6/site-packages/torch/utils/data/sampler.py", line 64, in init "value, but got num_samples={}".format(self.num_samples)) ValueError: num_samples should be a positive integeral value, but got num_samples=0

I converted my data to coco format, but this error occurred. can you help me?thanks a lot!

tianzhi0549 commented 5 years ago

@qianzhang2018 It seems that the dataloader didn't get any images. Please check your code.

qianzhang2018 commented 5 years ago

where is the “--images-dir” in train? it is in fcos_R_50_FPN_1x.yaml---DATASETS:?

qianzhang2018 commented 5 years ago

FCOS -----datasets -----coco ----- annotations ----- coco_2014_train ----- coco_2014_valminusminival i put my own traindata in coco_2014_train and val data in coco_2014_valminusminival is it right?

Mahmood-Hussain commented 3 years ago

FCOS -----datasets -----coco ----- annotations ----- coco_2014_train ----- coco_2014_valminusminival i put my own traindata in coco_2014_train and val data in coco_2014_valminusminival is it right?

I am facing the same issue. Would you tell me please where I am wrong?

loading annotations into memory... Done (t=0.02s) creating index... index created! loading annotations into memory... Done (t=0.00s) creating index... index created! Traceback (most recent call last): File "tools/train_net.py", line 181, in main() File "tools/train_net.py", line 174, in main model = train(cfg, args.local_rank, args.distributed) File "tools/train_net.py", line 67, in train start_iter=arguments["iteration"], File "/home/mahmood/FCOS/fcos_core/data/build.py", line 159, in make_data_loader sampler = make_data_sampler(dataset, shuffle, is_distributed) File "/home/mahmood/FCOS/fcos_core/data/build.py", line 63, in make_data_sampler sampler = torch.utils.data.sampler.RandomSampler(dataset) File "/home/mahmood/anaconda3/envs/FCOS/lib/python3.7/site-packages/torch/utils/data/sampler.py", line 94, in init "value, but got num_samples={}".format(self.num_samples)) ValueError: num_samples should be a positive integer value, but got num_samples=0 Traceback (most recent call last): File "/home/mahmood/anaconda3/envs/FCOS/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/home/mahmood/anaconda3/envs/FCOS/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/mahmood/anaconda3/envs/FCOS/lib/python3.7/site-packages/torch/distributed/launch.py", line 253, in main() File "/home/mahmood/anaconda3/envs/FCOS/lib/python3.7/site-packages/torch/distributed/launch.py", line 249, in main cmd=cmd) subprocess.CalledProcessError: Command '['/home/mahmood/anaconda3/envs/FCOS/bin/python', '-u', 'tools/train_net.py', '--local_rank=0', '--config-file',