Example #1
0
class Config(object):
    gpu_ids = [0, 1, 2, 3]

    device = torch.device('cuda:{}'.format(gpu_ids[0]))

    dataset = 'imagenet'

    data_root = xtils.get_data_root(data='imagenet')

    data_augment = {'train': 'rotate-rresize-1crop', 'val': '1resize-1crop',
                    'imsize': 256, 'insize': 224, 'color': True,
                    'degree': (0, 0), 'scale': (0.08, 1), 'ratio': (3. / 4, 4. / 3)}

    arch_name = ['hrnet', 'resnet50', 'resnet152', 'fishnet150', 'scalenet'][-1]

    arch_kwargs = [hrw18, hrw30, hrw32, vo69, vo72][-2]

    ckpt_file = os.path.join(xtils.get_pretrained_models(),
                             ['hrnetv2_w18_imagenet_pretrained.pth',
                              'fishnet150_ckpt.tar',
                              'resnet50-19c8e357.pth', 'resnet152-b121ed2d.pth',
                              'scale103-5.09M-71.63-vo69.pth',
                              'scale59-30.52M-74.86-vo72.pth'][-2])

    mgpus_to_sxpu = ['m2s', 's2m', 'none'][-1]

    image_size = 256

    input_size = int(0.875 * image_size)

    bsize_val = 256

    num_workers = 8

    print_freq = 20

    valid_total_time = 0

    random_seed = random.randint(0, 100) or None

    # 特殊模型的补充字段
    mode_custom = False
    xfc_which = -1
Example #2
0
    'resume_config':
    True,
    'resume_optimizer':
    True,
    'mgpus_to_sxpu': ['m2s', 's2m', 'none', 'auto'][3],

    # data config
    'dataset':
    'cifar10',
    'data_info': {
        'train_size': train_size,
        'val_size': 10000,
        'test_size': 5000
    },
    'data_root':
    xtils.get_data_root(data='cifar10'),
    'data_augment': {
        'train': '1crop-flip',
        'val': 'no-aug'
    },
    'data_kwargs': {},
    'data_workers':
    4,

    # path config
    'current_time':
    '',
    'ckpt_suffix':
    '',  # when save a ckpt, u can add a special mark to its filename.
    'ckpt_base_dir':
    xtils.get_base_dir(k='ckpt'),
Example #3
0
    # device config
    'gpu_ids': [0, 1, 2, 3, 4, 5, 6, 7, 8][0:4],

    # model config
    'arch_name': 'srnet',
    'arch_kwargs': {},
    'resume': None or '/data1/zhangjp/classify/checkpoints/imagenet/srnet/srnet-exp.sr1' + '/' +
              'imagenet-srnet67-ep339-it1701699-acc69.85-best76.20-topv93.11-par32.66M-norm-exp.sr1.ckpt',
    'resume_config': True,
    'resume_optimizer': True,
    'mgpus_to_sxpu': ['m2s', 's2m', 'none', 'auto'][3],

    # data config
    'dataset': 'imagenet',
    'data_info': {'train_size': train_size, 'val_size': 10000, 'test_size': 10000},
    'data_root': xtils.get_data_root(data='imagenet'),
    'data_augment': {'train': 'rotate-rresize-1crop', 'val': '1resize-1crop',
                     'imsize': 256, 'insize': 224, 'color': True, 'interp': 'bilinear',
                     'degree': (0, 0), 'scale': (0.08, 1), 'ratio': (3. / 4, 4. / 3)},
    'data_kwargs': {},
    'data_workers': 24,

    # path config
    'current_time': '',
    'ckpt_suffix': '',  # when save a ckpt, u can add a special mark to its filename.
    'ckpt_base_dir': xtils.get_base_dir(k='ckpt'),
    'ckpt_dir': 'auto-setting',
    'log_base_dir': xtils.get_base_dir(k='log'),
    'log_dir': 'auto-setting',

    # iter config
Example #4
0
    # device config
    'gpu_ids': [0, 1, 2, 3, 4, 5, 6, 7, 8][0:4],

    # model config
    'arch_name': 'scalenet',
    'arch_kwargs': {},
    'resume': None,
    'resume_config': True,
    'resume_optimizer': True,
    'mgpus_to_sxpu': ['m2s', 's2m', 'none', 'auto'][3],

    # data config
    'dataset': 'cifar10',
    'data_info': {'train_size': train_size, 'val_size': 10000, 'test_size': 5000},
    'data_root': xtils.get_data_root(data='cifar10'),
    'data_augment': {'train': '1crop-flip', 'val': 'no-aug'},
    'data_kwargs': {},
    'data_workers': 4,

    # path config
    'current_time': '',
    'ckpt_suffix': '',  # when save a ckpt, u can add a special mark to its filename.
    'ckpt_base_dir': xtils.get_base_dir(k='ckpt'),
    'ckpt_dir': 'auto-setting',
    'log_base_dir': xtils.get_base_dir(k='log'),
    'log_dir': 'auto-setting',

    # iter config
    'start_iter': 0,
    'max_iters': [100 * BN, 90 * BN, 60 * BN, 40 * BN, 120 * BN][0],
Example #5
0
    # device config
    'gpu_ids': [0, 1, 2, 3, 4, 5, 6, 7, 8][0:4],

    # model config
    'arch_name': 'msnet',
    'arch_kwargs': {},
    'resume': os.path.join(xtils.get_pretrained_models(), ''),
    'resume_config': False,
    'resume_optimizer': False,
    'mgpus_to_sxpu': ['m2s', 's2m', 'none', 'auto'][3],

    # data config
    'dataset': 'imagenet',
    'data_info': {'train_size': train_size, 'val_size': 50000, 'test_size': 50000},
    'data_root': xtils.get_data_root(data='imagenet'),
    'data_augment': {'train': 'rotate-rresize-1crop', 'val': '1resize-1crop',
                     'imsize': 256, 'insize': 224, 'color': True,
                     'degree': (0, 0), 'scale': (0.08, 1), 'ratio': (3. / 4, 4. / 3)},
    'data_kwargs': {},
    'data_workers': 12,

    # path config
    'current_time': '',
    'ckpt_suffix': '',  # when save a ckpt, u can add a special mark to its filename.
    'ckpt_base_dir': xtils.get_base_dir(k='ckpt'),
    'ckpt_dir': 'auto-setting',
    'log_base_dir': xtils.get_base_dir(k='log'),
    'log_dir': 'auto-setting',

    # iter config