sess.graph) logger.info('prepare coordinator') coord = tf.train.Coordinator() # enqueuer.set_coordinator(coord) # enqueuer.start() logger.info('Training Started.') time_started = time.time() last_gs_num = last_gs_num2 = 0 initial_gs_num = sess.run(global_step) df.reset_state() while True: for dp in df.get_data(): feed = dict(zip([input_node, heatmap_node, vectmap_node], dp)) _, gs_num = sess.run([train_op, global_step], feed_dict=feed) #print("DONEONDONEODNOEN") if gs_num > step_per_epoch * args.max_epoch: break if gs_num - last_gs_num >= 10: train_loss, train_loss_ll, train_loss_ll_paf, train_loss_ll_heat, lr_val, summary = sess.run( [ total_loss, total_loss_ll, total_loss_ll_paf, total_loss_ll_heat, learning_rate, merged_summary_op
format='[lmdb_dataset] %(asctime)s %(levelname)s %(message)s') if __name__ == '__main__': """ Speed Test for Getting Input batches from other nodes """ parser = argparse.ArgumentParser( description='Worker for preparing input batches.') parser.add_argument('--listen', type=str, default='tcp://0.0.0.0:1027') parser.add_argument('--show', type=bool, default=False) args = parser.parse_args() df = RemoteDataZMQ(args.listen) logging.info('tcp queue start') df.reset_state() t = time.time() for i, dp in enumerate(df.get_data()): if i == 100: break logging.info('Input batch %d received.' % i) if i == 0: for d in dp: logging.info('%d dp shape={}'.format(d.shape)) if args.show: CocoPose.display_image(dp[0][0], dp[1][0], dp[2][0]) logging.info('Speed Test Done for 100 Batches in %f seconds.' % (time.time() - t))
from pose_dataset import CocoPose logging.basicConfig(level=logging.DEBUG, format='[lmdb_dataset] %(asctime)s %(levelname)s %(message)s') if __name__ == '__main__': """ Speed Test for Getting Input batches from other nodes """ parser = argparse.ArgumentParser(description='Worker for preparing input batches.') parser.add_argument('--listen', type=str, default='tcp://0.0.0.0:1027') parser.add_argument('--show', type=bool, default=False) args = parser.parse_args() df = RemoteDataZMQ(args.listen) logging.info('tcp queue start') df.reset_state() t = time.time() for i, dp in enumerate(df.get_data()): if i == 100: break logging.info('Input batch %d received.' % i) if i == 0: for d in dp: logging.info('%d dp shape={}'.format(d.shape)) if args.show: CocoPose.display_image(dp[0][0], dp[1][0], dp[2][0]) logging.info('Speed Test Done for 100 Batches in %f seconds.' % (time.time() - t))