raise Exception("No GPU found")
    else:
        print("===> GPU on")

    # Normalization method
    mean = get_mean(args.norm_value)
    std = get_std(args.norm_value)

    norm_method = Normalize(mean, std)

    # path setting
    train_path = args.train_data
    pretrain_path = join(args.root_path, args.pretrain_path)
    log_path = join(args.root_path, args.log_path)

    print("===> Loading datasets")
    train_data = DatasetFromFolderTrain(
        train_path, args.resize_w, args.resize_h, args.crop_size, args.fps,
        args.train_frames, args.horizontal_flip, args.norm_value, norm_method,
        args.num_of_vid, args.train_frames, args.label_condition)
    train_data_loader = DataLoader(dataset=train_data,
                                   num_workers=4,
                                   batch_size=args.batch_size,
                                   shuffle=True)

    print("===> Setting Trainer")

    trainer = TrainModule(args)

    print("===> Training")
    trainer.train()
예제 #2
0
    std = get_std(args.norm_value)
    norm_method = Normalize(mean, std)

    # path setting
    train_path = args.train_data
    pretrain_path = join(args.root_path, args.pretrain_path)
    log_path = join(args.root_path, args.log_path)

    print("===> Loading datasets")
    train_data = DatasetFromFolderTrain(train_path,
                                        args.resize_w,
                                        args.resize_h,
                                        args.crop_size,
                                        args.fps,
                                        args.train_frames,
                                        args.horizontal_flip,
                                        norm_method,
                                        args.num_of_vid,
                                        args.train_frames,
                                        args.with_label,
                                        args.with_condition,
                                        args.prev_frame)

    train_data_loader = DataLoader(dataset=train_data,
                                   num_workers=4,
                                   batch_size=args.batch_size,
                                   shuffle=True)

    print("===> Setting Trainer")

    trainer = TrainModule(args)