Exemplo n.º 1
0
                            pretrained=True,
                            class_agnostic=args.class_agnostic)
    elif args.net == 'res18':
        if args.coco:
            fasterRCNN = resnet(range(81),
                                18,
                                pretrained=False,
                                class_agnostic=args.class_agnostic)
        else:
            fasterRCNN = resnet(pascal_classes,
                                18,
                                pretrained=False,
                                class_agnostic=args.class_agnostic)
    elif args.net == 'squeeze':
        fasterRCNN = squeeze(pascal_classes,
                             pretrained=True,
                             class_agnostic=args.class_agnostic)
    elif args.net == 'alex':
        fasterRCNN = alex(pascal_classes,
                          pretrained=True,
                          class_agnostic=args.class_agnostic)
    else:
        print("network is not defined")
        pdb.set_trace()

    fasterRCNN.create_architecture()
    #  print(fasterRCNN)
    print("load checkpoint %s" % (load_name))
    if args.cuda > 0:
        checkpoint = torch.load(load_name)
    else:
                            18,
                            pretrained=False,
                            class_agnostic=args.class_agnostic)
    elif args.net == 'res10':
        fasterRCNN = resnet(imdb.classes,
                            10,
                            pretrained=True,
                            class_agnostic=args.class_agnostic)
    elif args.net == 'res152':
        fasterRCNN = resnet(imdb.classes,
                            152,
                            pretrained=True,
                            class_agnostic=args.class_agnostic)
    elif args.net == 'squeeze':
        fasterRCNN = squeeze(imdb.classes,
                             pretrained=True,
                             class_agnostic=args.class_agnostic)
    elif args.net == 'alex':
        fasterRCNN = alex(imdb.classes,
                          pretrained=True,
                          class_agnostic=args.class_agnostic)
    else:
        print("network is not defined")
        pdb.set_trace()

    fasterRCNN.create_architecture()

    lr = cfg.TRAIN.LEARNING_RATE
    lr = args.lr

    params = []