def parse_args(): parser = argparse.ArgumentParser( description="Train classification models on ImageNet", formatter_class=argparse.ArgumentDefaultsHelpFormatter) models.add_model_args(parser) fit.add_fit_args(parser) data.add_data_args(parser) dali.add_dali_args(parser) data.add_data_aug_args(parser) return parser.parse_args()
default='sgd', help='the optimizer type') parser.add_argument('--model-prefix', type=str, default='models/', help='model prefix') parser.add_argument('--disp-batches', type=int, default=20, help='show progress for every n batches') parser.add_argument('--predict', action='store_true', default=False, help='run prediction instead of training') data.add_data_args(parser) parser.set_defaults( # config model_prefix='models/', disp_batches=20, # data data_config='data_ak8_pfcand_reduced_cloud', data_train=train_val_fname, train_val_split=0.8, data_test=test_fname, data_example=example_fname, data_names=None, num_examples=-1, # train batch_size=1024, num_epochs=200,
import argparse from data import get_data, add_data_args import torchvision.utils as vutils import matplotlib.pyplot as plt ########### ## Setup ## ########### parser = argparse.ArgumentParser() add_data_args(parser) parser.add_argument('--num_cols', type=int, default=8) args = parser.parse_args() ############### ## Load data ## ############### print('Loading data...') train_loader = get_data(args)[0] images = next(iter(train_loader)) ############### ## Plot data ## ############### print('images.shape = {}'.format(images.shape)) print('Plotting data...')