Пример #1
0
    pointcloud_samples=args.pc_samples,
    res=args.res,
    sample_distribution=args.sample_distribution,
    sample_sigmas=args.sample_sigmas,
    num_sample_points=50000,
    batch_size=args.batch_size,
    num_workers=30)

val_dataset = voxelized_data.VoxelizedDataset(
    'val',
    voxelized_pointcloud=args.pointcloud,
    pointcloud_samples=args.pc_samples,
    res=args.res,
    sample_distribution=args.sample_distribution,
    sample_sigmas=args.sample_sigmas,
    num_sample_points=50000,
    batch_size=args.batch_size,
    num_workers=30)

exp_name = 'i{}_dist-{}sigmas-{}v{}_m{}'.format(
    'PC' + str(args.pc_samples) if args.pointcloud else 'Voxels',
    ''.join(str(e) + '_' for e in args.sample_distribution),
    ''.join(str(e) + '_' for e in args.sample_sigmas), args.res, args.model)

trainer = training.Trainer(net,
                           torch.device("cuda"),
                           train_dataset,
                           val_dataset,
                           exp_name,
                           optimizer=args.optimizer)
trainer.train_model(1500)
Пример #2
0
    sample_sigmas=args.sample_sigmas,
    num_sample_points=50000,
    batch_size=args.batch_size,
    num_workers=30)

val_dataset = voxelized_data.VoxelizedDataset(
    'val',
    voxelized_pointcloud=args.pointcloud,
    pointcloud_samples=args.pc_samples,
    data_path=args.input_dir_val,
    res=args.res,
    sample_distribution=args.sample_distribution,
    sample_sigmas=args.sample_sigmas,
    num_sample_points=50000,
    batch_size=args.batch_size,
    num_workers=30)

exp_name = 'i{}_dist-{}sigmas-{}v{}_m{}_{}'.format(
    'PC' + str(args.pc_samples) if args.pointcloud else 'Voxels',
    ''.join(str(e) + '_' for e in args.sample_distribution),
    ''.join(str(e) + '_'
            for e in args.sample_sigmas), args.res, args.model, args.name)

trainer = training.Trainer(net,
                           Device,
                           train_dataset,
                           val_dataset,
                           exp_name,
                           optimizer=args.optimizer)
trainer.train_model(args.epochs)
Пример #3
0
import models.local_model as model
import models.dataloader as dataloader
from models import training
import argparse
import torch
import config.config_loader as cfg_loader

parser = argparse.ArgumentParser(description='Train Model')

parser.add_argument('config', type=str, help='Path to config file.')
args = parser.parse_args()

cfg = cfg_loader.load(args.config)

net = model.get_models()[cfg['model']]()

train_dataset = dataloader.VoxelizedDataset('train', cfg)

val_dataset = dataloader.VoxelizedDataset('val', cfg)

trainer = training.Trainer(net,
                           torch.device("cuda"),
                           train_dataset,
                           val_dataset,
                           cfg['folder_name'],
                           optimizer=cfg['training']['optimizer'])
trainer.train_model(1500)
Пример #4
0
                                          pointcloud_samples=cfg.num_points,
                                          data_path=cfg.data_dir,
                                          split_file=cfg.split_file,
                                          batch_size=cfg.batch_size,
                                          num_sample_points=cfg.num_sample_points_training,
                                          num_workers=30,
                                          sample_distribution=cfg.sample_ratio,
                                          sample_sigmas=cfg.sample_std_dev)
val_dataset = voxelized_data.VoxelizedDataset('val',
                                          res=cfg.input_res,
                                          pointcloud_samples=cfg.num_points,
                                          data_path=cfg.data_dir,
                                          split_file=cfg.split_file,
                                          batch_size=cfg.batch_size,
                                          num_sample_points=cfg.num_sample_points_training,
                                          num_workers=30,
                                          sample_distribution=cfg.sample_ratio,
                                          sample_sigmas=cfg.sample_std_dev)



trainer = training.Trainer(net,
                           torch.device("cuda"),
                           train_dataset,
                           val_dataset,
                           cfg.exp_name,
                           optimizer=cfg.optimizer,
                           lr=cfg.lr)

trainer.train_model(cfg.num_epochs)