Exemplo n.º 1
0
def main(_):
    tfconfig = tf.ConfigProto(allow_soft_placement = True)
    tfconfig.gpu_options.allow_growth = True
    with tf.Session(config = tfconfig) as sess:
        model = cycleGAN(sess,FLAGS)
        if FLAGS.phase == 'train':
            print("Training ...")
            model.train(FLAGS)
Exemplo n.º 2
0
def main():
    args = get_args()

    create_link(args.dataset_dir)
    if args.training:
        print("Training")
        model = md.cycleGAN(args)
        model.train(args)
    if args.testing:
        print("Testing")
        tst.test(args)
Exemplo n.º 3
0
def main():
    args = get_args()

    create_link(args.dataset_dir)

    str_ids = args.gpu_ids.split(',')
    args.gpu_ids = []
    for str_id in str_ids:
        id = int(str_id)
        if id >= 0:
            args.gpu_ids.append(id)
    print(not args.no_dropout)
    if args.training:
        print("Training")
        model = md.cycleGAN(args)
        model.train(args)
    if args.testing:
        print("Testing")
        model = md.cycleGAN(args)
        model.test(args)
Exemplo n.º 4
0
def main():
    args = get_args()

    create_link(args.dataset_dir)

    str_ids = args.gpu_ids.split(',')
    args.gpu_ids = []
    for str_id in str_ids:
        id = int(str_id)
        if id >= 0:
            args.gpu_ids.append(id)
    print(not args.no_dropout)
    md = model.cycleGAN(args)
    md.train(args)
Exemplo n.º 5
0
def main(args):
    create_link(args.dataset_dir)

    args.gpu_ids = []
    for i in range(torch.cuda.device_count()):
        args.gpu_ids.append(i)

    if args.training:
        print('Training')
        model = md.cycleGAN(args)
        model.train(args)

    if args.gen_samples:
        print('Generating samples')
        gen_samples.gen_samples(args, 'last')
Exemplo n.º 6
0
def main(_):
    """
    global main method
    """
    # input ('Main method will start , continue? press [Enter] to continue...')

    tfconfig = tf.ConfigProto(allow_soft_placement=True)
    tfconfig.gpu_options.allow_growth = True
    # tfconfig.gpu_options.per_process_gpu_memory_fraction = 0.9
    sess = tf.InteractiveSession(config=tfconfig)
    gan = cycleGAN(sess, args)
    if args.is_train:
        gan.train(args)
    else:
        gan.test(args)