def main(args):
    device = torch.device(('cuda' if torch.cuda.is_available() else 'cpu'))
    use_cuda = torch.cuda.is_available()
    model_folder = join(EXP_ROOT_DIR, args.exp_name, 'trained_models', args.run_name, time_stamped())
    if (not os.path.exists(model_folder)):
        os.makedirs(model_folder)
    builder = getattr(importlib.import_module('utils.builders'), args.builder)
    loss_fn = LOSS_FN
    train_directory = join(EXP_ROOT_DIR, args.exp_name, 'videos/train/')
    validation_directory = join(EXP_ROOT_DIR, args.exp_name, 'videos/valid/')
    if (not os.path.exists(('/'.join(os.path.realpath(__file__).split('/')[:(- 1)]) + '/experiments'))):
        os.makedirs(('/'.join(os.path.realpath(__file__).split('/')[:(- 1)]) + '/experiments'))
    copy2(('/'.join(os.path.realpath(__file__).split('/')[:(- 1)]) + '/train_tcn_no_captions.py'), model_folder)
    copy2((('/'.join(os.path.realpath(__file__).split('/')[:(- 2)]) + '/gps-lfd') + '/config.py'), model_folder)
    trainer = Trainer(use_cuda, args.load_model, model_folder, train_directory, validation_directory, builder, loss_fn, args)
    trainer.train()
def main(args):
    device = torch.device(('cuda' if torch.cuda.is_available() else 'cpu'))
    use_cuda = torch.cuda.is_available()
    model_folder = join(EXP_ROOT_DIR, args.exp_name, 'trained_models', args.run_name, time_stamped())
    if (not os.path.exists(model_folder)):
        os.makedirs(model_folder)
    builder = getattr(importlib.import_module('utils.builders'), args.builder)
    loss_fn = LOSS_FN
    train_directory = join(EXP_ROOT_DIR, args.exp_name, 'videos/train/')
    validation_directory = join(EXP_ROOT_DIR, args.exp_name, 'videos/valid/')
    if (not os.path.exists(('/'.join(os.path.realpath(__file__).split('/')[:(- 1)]) + '/experiments'))):
        os.makedirs(('/'.join(os.path.realpath(__file__).split('/')[:(- 1)]) + '/experiments'))
    copy2(('/'.join(os.path.realpath(__file__).split('/')[:(- 1)]) + '/train_tcn_no_captions.py'), model_folder)
    copy2((('/'.join(os.path.realpath(__file__).split('/')[:(- 2)]) + '/gps-lfd') + '/config.py'), model_folder)
    trainer = Trainer(use_cuda, args.load_model, model_folder, train_directory, validation_directory, builder, loss_fn, args)
    trainer.train()