Exemple #1
0
    parser.add_argument('--no-cuda',
                        action='store_true',
                        default=False,
                        help='disables cuda')

    parser.set_defaults(hflip=False)
    opt = parser.parse_args()

    assert opt.vae_levels > 0
    assert opt.disc_loss_weight > 0

    # Define Saver
    opt.saver = utils.VideoSaver(opt)

    # Define Tensorboard Summary
    opt.summary = utils.TensorboardSummary(opt.saver.experiment_dir)
    logger.configure_logging(
        os.path.abspath(os.path.join(opt.saver.experiment_dir, 'logbook.txt')))

    # CUDA
    device = 'cuda' if torch.cuda.is_available() and not opt.no_cuda else 'cpu'
    opt.device = device
    if torch.cuda.is_available() and device == 'cpu':
        logging.info(
            "WARNING: You have a CUDA device, so you should probably run with --cuda"
        )

    # Initial config
    opt.noise_amp_init = opt.noise_amp
    opt.scale_factor_init = opt.scale_factor
Exemple #2
0
                    continue
                try:
                    setattr(opt, log_arg[0], ast.literal_eval(log_arg[1]))
                except Exception:
                    setattr(opt, log_arg[0], log_arg[1])

        opt.netG = os.path.join(exp_dir, opt.netG)
        if not os.path.exists(opt.netG):
            logging.info('Skipping {}, file not exists!'.format(opt.netG))
            continue

        # Define Saver
        opt.saver = utils.VideoSaver(opt)

        # Define Tensorboard Summary
        opt.summary = utils.TensorboardSummary(opt.saver.eval_dir)

        # Logger
        logger.configure_logging(
            os.path.abspath(os.path.join(opt.experiment_dir, 'logbook.txt')))

        # CUDA
        device = 'cuda' if torch.cuda.is_available(
        ) and not opt.no_cuda else 'cpu'
        opt.device = device
        if torch.cuda.is_available() and device == 'cpu':
            logging.info(
                "WARNING: You have a CUDA device, so you should probably run with --cuda"
            )

        # Adjust scales
Exemple #3
0
    assert opt.vae_levels > 0
    assert opt.disc_loss_weight > 0

    if opt.data_rep < opt.batch_size:
        opt.data_rep = opt.batch_size

    # Define Saver
    opt.saver = utils.ImageSaver(opt)

    # Define Tensorboard Summary
    if use_neptune and opt.tag:
        neptune_exp = neptune.create_experiment(name=opt.checkname,
                                                params=opt.__dict__,
                                                tags=[opt.tag]).__enter__()
        opt.summary = utils.TensorboardSummary(opt.saver.experiment_dir,
                                               neptune_exp=neptune_exp)
    else:
        opt.summary = utils.TensorboardSummary(opt.saver.experiment_dir)

    logger.configure_logging(
        os.path.abspath(os.path.join(opt.saver.experiment_dir, 'logbook.txt')))

    # CUDA
    device = 'cuda' if torch.cuda.is_available() and not opt.no_cuda else 'cpu'
    opt.device = device
    if torch.cuda.is_available() and device == 'cpu':
        logging.info(
            "WARNING: You have a CUDA device, so you should probably run with --cuda"
        )

    # Initial config