def main(unused_args): np.set_printoptions(precision=3, suppress=True, threshold=int(1e9), linewidth=80) print('-' * 80) if not gfile.IsDirectory(FLAGS.output_dir): print('Path {} does not exist. Creating'.format(FLAGS.output_dir)) gfile.MakeDirs(FLAGS.output_dir) elif FLAGS.reset_output_dir: print('Path {} exists. Reseting'.format(FLAGS.output_dir)) gfile.DeleteRecursively(FLAGS.output_dir) gfile.MakeDirs(FLAGS.output_dir) print('-' * 80) log_file = os.path.join(FLAGS.output_dir, 'stdout') print('Logging to {}'.format(log_file)) sys.stdout = utils.Logger(log_file) params = contrib_training.HParams( data_path=FLAGS.data_path, log_every=FLAGS.log_every, output_dir=FLAGS.output_dir, ) train(params)
def main(unused_args): print('-' * 80) output_dir = FLAGS.output_dir print('-' * 80) if not gfile.IsDirectory(output_dir): print('Path {} does not exist. Creating'.format(output_dir)) gfile.MakeDirs(output_dir) elif FLAGS.reset_output_dir: print('Path {} exists. Reseting'.format(output_dir)) gfile.DeleteRecursively(output_dir) gfile.MakeDirs(output_dir) print('-' * 80) log_file = os.path.join(output_dir, 'stdout') print('Logging to {}'.format(log_file)) sys.stdout = utils.Logger(log_file) params = contrib_training.HParams( data_path=FLAGS.data_path, log_every=FLAGS.log_every, output_dir=output_dir, ) train(params)