提交 50b190db 编写于 作者: T typhoonzero

update

上级 9e23a870
...@@ -136,10 +136,11 @@ def _reader_creator(file_list, ...@@ -136,10 +136,11 @@ def _reader_creator(file_list,
def reader(): def reader():
with open(file_list) as flist: with open(file_list) as flist:
full_lines = [line.strip() for line in flist] full_lines = [line.strip() for line in flist]
pass_id_as_seed_counter = pass_id_as_seed
while True: while True:
if shuffle: if shuffle:
if pass_id_as_seed: if pass_id_as_seed_counter:
np.random.seed(pass_id_as_seed) np.random.seed(pass_id_as_seed_counter)
np.random.shuffle(full_lines) np.random.shuffle(full_lines)
if mode == 'train' and os.getenv('PADDLE_TRAINING_ROLE'): if mode == 'train' and os.getenv('PADDLE_TRAINING_ROLE'):
# distributed mode if the env var `PADDLE_TRAINING_ROLE` exits # distributed mode if the env var `PADDLE_TRAINING_ROLE` exits
...@@ -166,8 +167,8 @@ def _reader_creator(file_list, ...@@ -166,8 +167,8 @@ def _reader_creator(file_list,
yield [img_path] yield [img_path]
if not infinite: if not infinite:
break break
pass_id_as_seed += 1 pass_id_as_seed_counter += 1
print("passid ++, current: ", pass_id_as_seed) print("passid ++, current: ", pass_id_as_seed_counter)
mapper = functools.partial( mapper = functools.partial(
process_image, mode=mode, color_jitter=color_jitter, rotate=rotate) process_image, mode=mode, color_jitter=color_jitter, rotate=rotate)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册