def main(unused_argv):
print("tensorflow version: %s" % tf.__version__)
all_frame_files = gfile.Glob(FLAGS.input_data_pattern)
f_fullpath = all_frame_files[FLAGS.file_from : FLAGS.file_to]
f_fns = [x.split('/')[-1] for x in f_fullpath]
exist_files = gfile.Glob(FLAGS.output_path + "C*tfrecord")
exist_fn = [x.split('/')[-1].replace('CAtr', 'Atr') for x in exist_files]
yet_2_split = [x for x,y in zip(f_fullpath, f_fns) if y not in exist_fn]
vf = [FLAGS.output_path + 'C' + x.split('/')[-1] for x in yet_2_split]
mylog('number of files suggested: %d'%len(f_fullpath))
mylog('number of files yet to process: %d'%len(yet_2_split))
if FLAGS.parallel:
from concurrent import futures
executor = futures.ProcessPoolExecutor(max_workers=2)
executor.map(process_one_file, zip(yet_2_split, vf))
else:
for filenames in zip(yet_2_split, vf):
#mylog('processing: {}'.format(filenames))
process_one_file(filenames)
mylog("done")
评论列表
文章目录