clovaai / deep-text-recognition-benchmark

Text recognition (optical character recognition) with deep learning methods, ICCV 2019
Apache License 2.0
3.72k stars 1.09k forks source link

please help my code {ValueError: num_samples should be a positive integer value, but got num_samples=0} #213

Open Doracoon opened 4 years ago

Doracoon commented 4 years ago

Filtering the images containing characters which are not in opt.character Filtering the images whose label is longer than opt.batch_max_length

dataset_root: data_lmdb/training opt.select_data: ['/'] opt.batch_ratio: ['1']

dataset_root: data_lmdb/training dataset: / sub-directory: /. num samples: 0 num total samples of /: 0 x 1.0 (total_data_usage_ratio) = 0 num samples of / per batch: 192 x 1.0 (batch_ratio) = 192 Traceback (most recent call last): File "train.py", line 317, in train(opt) File "train.py", line 31, in train train_dataset = Batch_Balanced_Dataset(opt) File "/content/drive/My Drive/deep-text-recognition-benchmark/dataset.py", line 67, in init collate_fn=_AlignCollate, pin_memory=True) File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 224, in init sampler = RandomSampler(dataset, generator=generator) File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/sampler.py", line 96, 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

i dont know why... i changed batch_raio, select_data, character default in train.py

ChaseMonsterAway commented 4 years ago

Maybe you should check the your data path, and make sure the data in a right way. By the way, do you have any interest to take a look at our STR toolbox vedastr?

youngsirsk commented 3 years ago

Did you solve this problem? I have the same question, if you have solved this, could you tell me how to solve it? Thanks!

ceyxasm commented 2 years ago

It is a filtering issue. Just turn it off by --data_filtering_off when training

Chen-chang-yu commented 8 months ago

add " --data_filtering_off --workers 0", it will solve your problem.