def main():
    import torch
    print('Torch version:', torch.__version__)
    print(torch.cuda.is_available())
    parser = argparse.ArgumentParser()
    parser.add_argument('--num_epochs', type=int, default=25, help='number of epochs to train')
    parser.add_argument('--output_dir', type=str, help='output directory')
    parser.add_argument('--learning_rate', type=float, default=0.001, help='learning rate')
    parser.add_argument('--momentum', type=float, default=0.9, help='momentum')
    args = parser.parse_args()
    data_dir = download_data()
    print(('data directory is: ' + data_dir))
    model = fine_tune_model(args.num_epochs, data_dir, args.learning_rate, args.momentum)
    os.makedirs(args.output_dir, exist_ok=True)
    torch.save(model, os.path.join(args.output_dir, 'model.pt'))
    model = Model.register(model_name='my_model', model_path=os.path.join(args.output_dir, 'model.pt'), workspace=ws)
def main():
    import torch
    print('Torch version:', torch.__version__)
    print(torch.cuda.is_available())
    parser = argparse.ArgumentParser()
    parser.add_argument('--num_epochs', type=int, default=25, help='number of epochs to train')
    parser.add_argument('--output_dir', type=str, help='output directory')
    parser.add_argument('--learning_rate', type=float, default=0.001, help='learning rate')
    parser.add_argument('--momentum', type=float, default=0.9, help='momentum')
    args = parser.parse_args()
    data_dir = download_data()
    print(('data directory is: ' + data_dir))
    model = fine_tune_model(args.num_epochs, data_dir, args.learning_rate, args.momentum)
    os.makedirs(args.output_dir, exist_ok=True)
    torch.save(model, os.path.join(args.output_dir, 'model.pt'))
    model = Model.register(model_name='my_model', model_path=os.path.join(args.output_dir, 'model.pt'), workspace=ws)