def do_flop(cfg):
    data_loader = build_detection_test_loader(cfg, cfg.DATASETS.TEST[0])
    model = build_model(cfg)
    DetectionCheckpointer(model).load(cfg.MODEL.WEIGHTS)
    model.eval()
    counts = Counter()
    for (idx, data) in zip(tqdm.trange(args.num_inputs), data_loader):
        counts += flop_count_operators(model, data)
    logger.info(('(G)Flops for Each Type of Operators:\n' + str([(k, (v / idx)) for (k, v) in counts.items()])))
def do_flop(cfg):
    data_loader = build_detection_test_loader(cfg, cfg.DATASETS.TEST[0])
    model = build_model(cfg)
    DetectionCheckpointer(model).load(cfg.MODEL.WEIGHTS)
    model.eval()
    counts = Counter()
    for (idx, data) in zip(tqdm.trange(args.num_inputs), data_loader):
        counts += flop_count_operators(model, data)
    logger.info(('(G)Flops for Each Type of Operators:\n' + str([(k, (v / idx)) for (k, v) in counts.items()])))