Пример #1
0

    print('Creating Iterator with {} Images'.format(len(roidb)))
    train_iter = MNIteratorE2E(roidb=roidb, config=config, batch_size=batch_size, nGPUs=nGPUs,
                               threads=config.TRAIN.NUM_THREAD, pad_rois_to=400) #, crop_size=(config.TRAIN.SCALES[-1],config.TRAIN.SCALES[-1]))
    print('The Iterator has {} samples!'.format(len(train_iter)))

    # Creating the Logger
    logger, output_path = create_logger(config.output_path, args.cfg, config.dataset.image_set)

    # get list of fixed parameters
    print('Initializing the model...')
    sym_inst = eval('{}.{}'.format(config.symbol, config.symbol))(n_proposals=400, momentum=args.momentum)
    sym = sym_inst.get_symbol_rcnn(config)

    fixed_param_names = get_fixed_param_names(config.network.FIXED_PARAMS, sym)

    # Creating the module
    mod = mx.mod.Module(symbol=sym,
                        context=context,
                        data_names=[k[0] for k in train_iter.provide_data_single],
                        label_names=[k[0] for k in train_iter.provide_label_single],
                        fixed_param_names=fixed_param_names)

    shape_dict = dict(train_iter.provide_data_single + train_iter.provide_label_single)
    sym_inst.infer_shape(shape_dict)
    arg_params, aux_params = load_param(config.network.pretrained, config.network.pretrained_epoch, convert=True)

    sym_inst.init_weight_rcnn(config, arg_params, aux_params)

    # Creating the metrics
Пример #2
0

    print('Creating Iterator with {} Images'.format(len(roidb)))
    train_iter = MNIteratorE2E(roidb=roidb, config=config, batch_size=batch_size, nGPUs=nGPUs,
                               threads=config.TRAIN.NUM_THREAD, pad_rois_to=400)
    print('The Iterator has {} samples!'.format(len(train_iter)))

    # Creating the Logger
    logger, output_path = create_logger(config.output_path, args.cfg, config.dataset.image_set)

    # get list of fixed parameters
    print('Initializing the model...')
    sym_inst = eval('{}.{}'.format(config.symbol, config.symbol))(n_proposals=400, momentum=args.momentum)
    sym = sym_inst.get_symbol_rcnn(config)

    fixed_param_names = get_fixed_param_names(config.network.FIXED_PARAMS, sym)

    # Creating the module
    mod = mx.mod.Module(symbol=sym,
                        context=context,
                        data_names=[k[0] for k in train_iter.provide_data_single],
                        label_names=[k[0] for k in train_iter.provide_label_single],
                        fixed_param_names=fixed_param_names)

    shape_dict = dict(train_iter.provide_data_single + train_iter.provide_label_single)
    sym_inst.infer_shape(shape_dict)
    arg_params, aux_params = load_param(config.network.pretrained, config.network.pretrained_epoch, convert=True)

    sym_inst.init_weight_rcnn(config, arg_params, aux_params)

    # Creating the metrics