From fb5f7f5eb418fc6d1ab6d62063516686d1a8d22a Mon Sep 17 00:00:00 2001 From: littletomatodonkey <2120160898@bit.edu.cn> Date: Tue, 20 Apr 2021 23:47:40 +0800 Subject: [PATCH] fix loader cause it does not need to break (#2562) * fix loader cause it does not need to be rebuild for each epoch * fix loader for dynamic sample * rm thin import --- ppocr/utils/e2e_utils/extract_textpoint_fast.py | 1 - tools/program.py | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/ppocr/utils/e2e_utils/extract_textpoint_fast.py b/ppocr/utils/e2e_utils/extract_textpoint_fast.py index 06a68d3a..787cd301 100644 --- a/ppocr/utils/e2e_utils/extract_textpoint_fast.py +++ b/ppocr/utils/e2e_utils/extract_textpoint_fast.py @@ -21,7 +21,6 @@ import math import numpy as np from itertools import groupby -from cv2.ximgproc import thinning as thin from skimage.morphology._skeletonize import thin diff --git a/tools/program.py b/tools/program.py index c22bf18b..d4c35838 100755 --- a/tools/program.py +++ b/tools/program.py @@ -196,10 +196,8 @@ def train(config, train_reader_cost = 0.0 batch_sum = 0 batch_start = time.time() - for idx, batch in enumerate(train_dataloader): + for idx, batch in enumerate(train_dataloader()): train_reader_cost += time.time() - batch_start - if idx >= len(train_dataloader): - break lr = optimizer.get_lr() images = batch[0] if use_srn: -- GitLab