From 92841044bf8234fa9490d75eda616c1b97549c47 Mon Sep 17 00:00:00 2001 From: littletomatodonkey Date: Wed, 12 Aug 2020 13:21:31 +0000 Subject: [PATCH] fix error --- ppocr/data/rec/dataset_traversal.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ppocr/data/rec/dataset_traversal.py b/ppocr/data/rec/dataset_traversal.py index ec3e9d86..49608bd9 100755 --- a/ppocr/data/rec/dataset_traversal.py +++ b/ppocr/data/rec/dataset_traversal.py @@ -247,10 +247,12 @@ class SimpleReader(object): print("multiprocess is not fully compatible with Windows." "num_workers will be 1.") self.num_workers = 1 - if self.batch_size * get_device_num() > img_num: + if self.batch_size * get_device_num( + ) * self.num_workers > img_num: raise Exception( - "The number of the whole data ({}) is smaller than the batch_size * devices_num ({})". - format(img_num, self.batch_size * get_device_num())) + "The number of the whole data ({}) is smaller than the batch_size * devices_num * num_workers ({})". + format(img_num, self.batch_size * get_device_num() * + self.num_workers)) for img_id in range(process_id, img_num, self.num_workers): label_infor = label_infor_list[img_id_list[img_id]] substr = label_infor.decode('utf-8').strip("\n").split("\t") -- GitLab