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
This commit is contained in:
littletomatodonkey 2021-04-20 23:47:40 +08:00 committed by GitHub
parent 88c6ad8a31
commit fb5f7f5eb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 4 deletions

View File

@ -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

View File

@ -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: