Exemple #1
0
        val_set = None
    else:
        train_set = MF(train=True, real=real, **kwargs)
        val_set = MF(train=False, real=real, **kwargs)
else:
    raise NotImplementedError

# trainer
config_name = args.config_file.split('/')[-1]
config_name = config_name.split('.')[0]
experiment_name = '{:s}_{:s}_{:s}_{:s}'.format(args.dataset, args.scene,
                                               args.model, config_name)
if args.learn_beta:
    experiment_name = '{:s}_learn_beta'.format(experiment_name)
if args.learn_gamma:
    experiment_name = '{:s}_learn_gamma'.format(experiment_name)
experiment_name += args.suffix
trainer = Trainer(model,
                  optimizer,
                  train_criterion,
                  args.config_file,
                  experiment_name,
                  train_set,
                  val_set,
                  device=args.device,
                  checkpoint_file=args.checkpoint,
                  resume_optim=args.resume_optim,
                  val_criterion=val_criterion)
lstm = args.model == 'vidloc'
trainer.train_val(lstm=lstm)
Exemple #2
0
    train_set = Env(train=True, **kwargs)
    val_set = Env(train=False, **kwargs)
elif args.model.find('mapnet') >= 0:
    kwargs = dict(kwargs, skip=skip, steps=steps)
    train_set = MF(train=True, **kwargs)
    val_set = MF(train=False, **kwargs)
else:
    raise NotImplementedError

# trainer
config_name = args.config_file.split('/')[-1]
config_name = config_name.split('.')[0]
if args.reduce is None:
    experiment_name = '{:s}_{:s}_{:s}_{:s}'.format(args.dataset, args.scene,
                                                   args.model, config_name)
else:
    experiment_name = '{:s}_{:s}_{:s}_{:s}_reduce'.format(
        args.dataset, args.scene, args.model, config_name)
trainer = Trainer(model,
                  optimizer,
                  train_criterion,
                  args.config_file,
                  experiment_name,
                  train_set,
                  val_set,
                  device='0',
                  checkpoint_file=args.checkpoint,
                  resume_optim=False,
                  val_criterion=val_criterion)
trainer.train_val()
Exemple #3
0
    experiment_name = '{:s}_augmented'.format(experiment_name)
elif args.use_augmentation == 'only':
    experiment_name = '{:s}_only_augmented'.format(experiment_name)
if args.use_stylization:
    experiment_name = '{:s}_stylized'.format(experiment_name)
    if args.use_stylization > 1:
        experiment_name = '{:s}_{:d}_styles'.format(experiment_name,
                                                    args.use_stylization)
if args.use_synthetic:
    experiment_name = '{:s}_synthetic'.format(experiment_name)
if det_seed >= 0:
    experiment_name = '{:s}_seed{}'.format(experiment_name, det_seed)
#if args.styles > 0:
#    experiment_name = '{:s}_{}_styles'.format(experiment_name, args.styles)
experiment_name += args.suffix
trainer = Trainer(model,
                  optimizer,
                  train_criterion,
                  args.config_file,
                  experiment_name,
                  train_set,
                  val_set,
                  device=args.device,
                  checkpoint_file=args.checkpoint,
                  visdom_server=args.server,
                  visdom_port=args.port,
                  resume_optim=args.resume_optim,
                  val_criterion=val_criterion)
lstm = args.model == 'vidloc'
trainer.train_val(lstm=lstm, dual_target='multitask' in args.model)