NVlabs / wetectron

Weakly-supervised object detection.
Other
361 stars 45 forks source link

mAP results of OICR just 38.53% on voc_2007 #45

Closed hust-lidelong closed 3 years ago

hust-lidelong commented 3 years ago

Nice work, but when I run this code, the result is worse. Do you know why? Thank you!

My get starte training instrunctions:

python tools/train_net.py \ --config-file "configs/voc/V_16_voc07.yaml" --use-tensorboard \ --skip-test \ OUTPUT_DIR output/training/ \ SOLVER.IMS_PER_BATCH 2 \ SOLVER.ITER_SIZE 1 \ DB.METHOD none

My INFO:

2021-03-21 20:15:01,469 wetectron INFO: Using 1 GPUs 2021-03-21 20:15:01,478 wetectron INFO: Namespace(config_file='configs/voc/V_16_voc07.yaml', distributed=False, local_rank=0, opts=['OUTPUT_DIR', 'output/training/', 'SOLVER.IMS_PER_BATCH', '2', 'SOLVER.ITER_SIZE', '1', 'DB.METHOD', 'none'], skip_test=True, use_tensorboard=True) 2021-03-21 20:15:01,478 wetectron INFO: Collecting env info (might take some time) 2021-03-21 20:15:03,539 wetectron INFO: PyTorch version: 1.6.0 Is debug build: No CUDA used to build PyTorch: 10.1

OS: Ubuntu 16.04.3 LTS GCC version: (crosstool-NG fa8859cb) 7.2.0 CMake version: version 3.11.3

Python version: 3.6 Is CUDA available: Yes CUDA runtime version: 10.1.243 GPU models and configuration: GPU 0: GeForce GTX 1080 Ti Nvidia driver version: 455.38 cuDNN version: /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn.so.7

Versions of relevant libraries: [pip3] numpy==1.16.0 [pip3] numpydoc==0.7.0 [pip3] pytorch-cns==0.3.1 [pip3] torch==1.6.0 [pip3] torchfile==0.1.0 [pip3] torchnet==0.0.4 [pip3] torchsummary==1.5.1 [pip3] torchvision==0.7.0 [conda] blas 1.0 mkl defaults [conda] cuda90 1.0 h6433d27_0 pytorch [conda] cudatoolkit 10.1.243 h6bb024c_0 defaults [conda] mkl 2018.0.0 hb491cac_4 defaults [conda] mkl-service 1.1.2 py36h17a0993_4 defaults [conda] numpy 1.13.3 py36ha266831_3 defaults [conda] numpy 1.16.0 [conda] numpydoc 0.7.0 py36h18f165f_0 defaults [conda] pytorch 1.6.0 py3.6_cuda10.1.243_cudnn7.6.3_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch [conda] pytorch-cns 0.3.1 [conda] torch 1.0.1 [conda] torch 0.3.1 [conda] torchfile 0.1.0 [conda] torchnet 0.0.4 [conda] torchsummary 1.5.1 [conda] torchvision 0.7.0 py36_cu101 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch Pillow (4.2.1) 2021-03-21 20:15:03,539 wetectron INFO: Loaded configuration file configs/voc/V_16_voc07.yaml 2021-03-21 20:15:03,540 wetectron INFO: MODEL: META_ARCHITECTURE: "GeneralizedRCNN" WEIGHT: "catalog://VGGImageNetPretrained/JCJOHNS/VGG-16" BACKBONE: CONV_BODY: "VGG16-OICR" WSOD_ON: True FASTER_RCNN: False ROI_HEADS: SCORE_THRESH: 0.0 NMS: 0.3 ROI_BOX_HEAD: NUM_CLASSES: 21 POOLER_METHOD: "ROIPool" POOLER_RESOLUTION: 7 POOLER_SCALES: (0.125,) FEATURE_EXTRACTOR: "VGG16.roi_head" ROI_WEAK_HEAD: PREDICTOR: "MISTPredictor" LOSS: "RoIRegLoss" OICR_P: 0.15 REGRESS_ON: True DB: METHOD: 'concrete' #原为'concrete' DATASETS: TRAIN: ("voc_2007_train", "voc_2007_val") TEST: ("voc_2007_test",) PROPOSAL_FILES: TRAIN: ('proposal/SS-voc_2007_train-boxes.pkl','proposal/SS-voc_2007_val-boxes.pkl') TEST: ('proposal/SS-voc_2007_test-boxes.pkl',) DATALOADER: SIZE_DIVISIBILITY: 32 INPUT: MIN_SIZE_TRAIN: (480, 576, 688, 864, 1000, 1200) MAX_SIZE_TRAIN: 2000 MIN_SIZE_TEST: 800 MAX_SIZE_TEST: 2000 SOLVER: IMS_PER_BATCH: 1 #原为8 BASE_LR: 0.01 WEIGHT_DECAY: 0.0001 WARMUP_ITERS: 200 STEPS: (20000, 26700) MAX_ITER: 30000 CHECKPOINT_PERIOD: 1000 SOLVER_CDB: BASE_LR: 0.0001 GAMMA: 3.0 WEIGHT_DECAY: 0.0001 STEPS: (20000, 26700) TEST: BBOX_AUG: ENABLED: True HEUR: "AVG" H_FLIP: True SCALES: (480, 576, 688, 864, 1000, 1200) MAX_SIZE: 2000 SCALE_H_FLIP: True SEED: 1234 2021-03-21 20:15:03,561 wetectron INFO: Running with config: AMP_VERBOSE: False DATALOADER: ASPECT_RATIO_GROUPING: True NUM_WORKERS: 4 SIZE_DIVISIBILITY: 32 DATASETS: TEST: ('voc_2007_test',) TRAIN: ('voc_2007_train', 'voc_2007_val') DB: GSM_THRES: 0.01 IS_HARD: True LR: 0.01 METHOD: none OPTIMIZER: sgd SIZE: 3 TAU: 0.3 WEIGHT: 0.01 DTYPE: float32 INPUT: BRIGHTNESS: 0.0 CONTRAST: 0.0 HUE: 0.0 MAX_SIZE_TEST: 2000 MAX_SIZE_TRAIN: 2000 MIN_SIZE_TEST: 800 MIN_SIZE_TRAIN: (480, 576, 688, 864, 1000, 1200) PCA: True PIXEL_MEAN: [102.9801, 115.9465, 122.7717] PIXEL_STD: [1.0, 1.0, 1.0] SATURATION: 0.0 TO_BGR255: True VERTICAL_FLIP_PROB_TRAIN: 0.0 MODEL: BACKBONE: CONV_BODY: VGG16-OICR FREEZE_CONV_BODY_AT: 2 CLS_AGNOSTIC_BBOX_REG: False DEVICE: cuda FASTER_RCNN: False FBNET: ARCH: default ARCH_DEF: BN_TYPE: bn DET_HEAD_BLOCKS: [] DET_HEAD_LAST_SCALE: 1.0 DET_HEAD_STRIDE: 0 DW_CONV_SKIP_BN: True DW_CONV_SKIP_RELU: True KPTS_HEAD_BLOCKS: [] KPTS_HEAD_LAST_SCALE: 0.0 KPTS_HEAD_STRIDE: 0 MASK_HEAD_BLOCKS: [] MASK_HEAD_LAST_SCALE: 0.0 MASK_HEAD_STRIDE: 0 RPN_BN_TYPE: RPN_HEAD_BLOCKS: 0 SCALE_FACTOR: 1.0 WIDTH_DIVISOR: 1 FPN: USE_GN: False USE_RELU: False GROUP_NORM: DIM_PER_GP: -1 EPSILON: 1e-05 NUM_GROUPS: 32 KEYPOINT_ON: False MASK_ON: False META_ARCHITECTURE: GeneralizedRCNN RESNETS: BACKBONE_OUT_CHANNELS: 1024 DEFORMABLE_GROUPS: 1 NUM_GROUPS: 1 RES2_OUT_CHANNELS: 256 RES5_DILATION: 1 STAGE_WITH_DCN: (False, False, False, False) STEM_FUNC: StemWithFixedBatchNorm STEM_OUT_CHANNELS: 64 STRIDE_IN_1X1: True TRANS_FUNC: BottleneckWithFixedBatchNorm WIDTH_PER_GROUP: 64 WITH_MODULATED_DCN: False RETINANET: ANCHOR_SIZES: (32, 64, 128, 256, 512) ANCHOR_STRIDES: (8, 16, 32, 64, 128) ASPECT_RATIOS: (0.5, 1.0, 2.0) BBOX_REG_BETA: 0.11 BBOX_REG_WEIGHT: 4.0 BG_IOU_THRESHOLD: 0.4 FG_IOU_THRESHOLD: 0.5 INFERENCE_TH: 0.05 LOSS_ALPHA: 0.25 LOSS_GAMMA: 2.0 NMS_TH: 0.4 NUM_CLASSES: 81 NUM_CONVS: 4 OCTAVE: 2.0 PRE_NMS_TOP_N: 1000 PRIOR_PROB: 0.01 SCALES_PER_OCTAVE: 3 STRADDLE_THRESH: 0 USE_C5: True RETINANET_ON: False ROI_BOX_HEAD: CONV_HEAD_DIM: 256 DILATION: 1 FEATURE_EXTRACTOR: VGG16.roi_head MLP_HEAD_DIM: 1024 NUM_CLASSES: 21 NUM_STACKED_CONVS: 4 POOLER_METHOD: ROIPool POOLER_RESOLUTION: 7 POOLER_SAMPLING_RATIO: 0 POOLER_SCALES: (0.125,) PREDICTOR: FastRCNNPredictor USE_GN: False ROI_HEADS: BATCH_SIZE_PER_IMAGE: 512 BBOX_REG_WEIGHTS: (10.0, 10.0, 5.0, 5.0) BG_IOU_THRESHOLD: 0.5 DETECTIONS_PER_IMG: 100 FG_IOU_THRESHOLD: 0.5 NMS: 0.3 POSITIVE_FRACTION: 0.25 SCORE_THRESH: 0.0 USE_FPN: False ROI_KEYPOINT_HEAD: CONV_LAYERS: (512, 512, 512, 512, 512, 512, 512, 512) FEATURE_EXTRACTOR: KeypointRCNNFeatureExtractor MLP_HEAD_DIM: 1024 NUM_CLASSES: 17 POOLER_RESOLUTION: 14 POOLER_SAMPLING_RATIO: 0 POOLER_SCALES: (0.0625,) PREDICTOR: KeypointRCNNPredictor RESOLUTION: 14 SHARE_BOX_FEATURE_EXTRACTOR: True ROI_MASK_HEAD: CONV_LAYERS: (256, 256, 256, 256) DILATION: 1 FEATURE_EXTRACTOR: ResNet50Conv5ROIFeatureExtractor MLP_HEAD_DIM: 1024 POOLER_RESOLUTION: 14 POOLER_SAMPLING_RATIO: 0 POOLER_SCALES: (0.0625,) POSTPROCESS_MASKS: False POSTPROCESS_MASKS_THRESHOLD: 0.5 PREDICTOR: MaskRCNNC4Predictor RESOLUTION: 14 SHARE_BOX_FEATURE_EXTRACTOR: True USE_GN: False ROI_WEAK_HEAD: CENTER_LOSS_ALPHA: 0.5 CENTER_LOSS_WEIGHT: 0.003 LOSS: RoIRegLoss OICR_P: 0.15 PARTIAL_LABELS: none PREDICTOR: MISTPredictor REGRESS_HEUR: AVG REGRESS_ON: True ROI_LOSS_REFINE: False USE_TEMPLATE: False RPN: ANCHOR_SIZES: (32, 64, 128, 256, 512) ANCHOR_STRIDE: (16,) ASPECT_RATIOS: (0.5, 1.0, 2.0) BATCH_SIZE_PER_IMAGE: 256 BG_IOU_THRESHOLD: 0.3 FG_IOU_THRESHOLD: 0.7 FPN_POST_NMS_PER_BATCH: True FPN_POST_NMS_TOP_N_TEST: 2000 FPN_POST_NMS_TOP_N_TRAIN: 2000 MIN_SIZE: 0 NMS_THRESH: 0.7 POSITIVE_FRACTION: 0.5 POST_NMS_TOP_N_TEST: 1000 POST_NMS_TOP_N_TRAIN: 2000 PRE_NMS_TOP_N_TEST: 6000 PRE_NMS_TOP_N_TRAIN: 12000 RPN_HEAD: SingleConvRPNHead STRADDLE_THRESH: 0 USE_FPN: False RPN_ONLY: False WEIGHT: catalog://VGGImageNetPretrained/JCJOHNS/VGG-16 WSOD_ON: True OUTPUT_DIR: output/training/ PATHS_CATALOG: /media/linux/学习/目标检测代码/wetectron/wetectron/config/paths_catalog.py PROPOSAL_FILES: TEST: ('proposal/SS-voc_2007_test-boxes.pkl',) TRAIN: ('proposal/SS-voc_2007_train-boxes.pkl', 'proposal/SS-voc_2007_val-boxes.pkl') SEED: 1234 SOLVER: BASE_LR: 0.01 BIAS_LR_FACTOR: 2 CHECKPOINT_PERIOD: 1000 GAMMA: 0.1 IMS_PER_BATCH: 2 ITER_SIZE: 1 MAX_ITER: 30000 MOMENTUM: 0.9 STEPS: (20000, 26700) WARMUP_FACTOR: 0.3333333333333333 WARMUP_ITERS: 200 WARMUP_METHOD: linear WEIGHT_DECAY: 0.0001 WEIGHT_DECAY_BIAS: 0 SOLVER_CDB: BASE_LR: 0.0001 BIAS_LR_FACTOR: 2 GAMMA: 3.0 MOMENTUM: 0.9 STEPS: (20000, 26700) WARMUP_FACTOR: 0.3333333333333333 WARMUP_ITERS: 500 WARMUP_METHOD: linear WEIGHT_DECAY: 0.0001 WEIGHT_DECAY_BIAS: 0 TEST: BBOX_AUG: ENABLED: True HEUR: AVG H_FLIP: True MAX_SIZE: 2000 SCALES: (480, 576, 688, 864, 1000, 1200) SCALE_H_FLIP: True DETECTIONS_PER_IMG: 100 EXPECTED_RESULTS: [] EXPECTED_RESULTS_SIGMA_TOL: 4 IMS_PER_BATCH: 8 VIS_THRES: 0.5 2021-03-21 20:15:03,562 wetectron INFO: Saving config into: output/training/config.yml 2021-03-21 20:15:07,640 wetectron.utils.checkpoint INFO: Loading checkpoint from catalog://VGGImageNetPretrained/JCJOHNS/VGG-16 2021-03-21 20:15:07,659 wetectron.utils.checkpoint INFO: catalog://VGGImageNetPretrained/JCJOHNS/VGG-16 points to https://web.eecs.umich.edu/~justincj/models/vgg16-00b39a1b.pth 2021-03-21 20:15:07,659 wetectron.utils.checkpoint INFO: url https://web.eecs.umich.edu/~justincj/models/vgg16-00b39a1b.pth cached in /home/linux/.torch/models/vgg16-00b39a1b.pth 2021-03-21 20:15:09,249 wetectron.utils.model_serialization INFO: backbone.body.features.0.bias loaded from features.0.bias of shape (64,) 2021-03-21 20:15:09,249 wetectron.utils.model_serialization INFO: backbone.body.features.0.weight loaded from features.0.weight of shape (64, 3, 3, 3) 2021-03-21 20:15:09,249 wetectron.utils.model_serialization INFO: backbone.body.features.10.bias loaded from features.10.bias of shape (256,) 2021-03-21 20:15:09,249 wetectron.utils.model_serialization INFO: backbone.body.features.10.weight loaded from features.10.weight of shape (256, 128, 3, 3) 2021-03-21 20:15:09,249 wetectron.utils.model_serialization INFO: backbone.body.features.12.bias loaded from features.12.bias of shape (256,) 2021-03-21 20:15:09,249 wetectron.utils.model_serialization INFO: backbone.body.features.12.weight loaded from features.12.weight of shape (256, 256, 3, 3) 2021-03-21 20:15:09,249 wetectron.utils.model_serialization INFO: backbone.body.features.14.bias loaded from features.14.bias of shape (256,) 2021-03-21 20:15:09,249 wetectron.utils.model_serialization INFO: backbone.body.features.14.weight loaded from features.14.weight of shape (256, 256, 3, 3) 2021-03-21 20:15:09,249 wetectron.utils.model_serialization INFO: backbone.body.features.17.bias loaded from features.17.bias of shape (512,) 2021-03-21 20:15:09,250 wetectron.utils.model_serialization INFO: backbone.body.features.17.weight loaded from features.17.weight of shape (512, 256, 3, 3) 2021-03-21 20:15:09,250 wetectron.utils.model_serialization INFO: backbone.body.features.19.bias loaded from features.19.bias of shape (512,) 2021-03-21 20:15:09,250 wetectron.utils.model_serialization INFO: backbone.body.features.19.weight loaded from features.19.weight of shape (512, 512, 3, 3) 2021-03-21 20:15:09,250 wetectron.utils.model_serialization INFO: backbone.body.features.2.bias loaded from features.2.bias of shape (64,) 2021-03-21 20:15:09,250 wetectron.utils.model_serialization INFO: backbone.body.features.2.weight loaded from features.2.weight of shape (64, 64, 3, 3) 2021-03-21 20:15:09,250 wetectron.utils.model_serialization INFO: backbone.body.features.21.bias loaded from features.21.bias of shape (512,) 2021-03-21 20:15:09,250 wetectron.utils.model_serialization INFO: backbone.body.features.21.weight loaded from features.21.weight of shape (512, 512, 3, 3) 2021-03-21 20:15:09,250 wetectron.utils.model_serialization INFO: backbone.body.features.24.bias loaded from features.24.bias of shape (512,) 2021-03-21 20:15:09,250 wetectron.utils.model_serialization INFO: backbone.body.features.24.weight loaded from features.24.weight of shape (512, 512, 3, 3) 2021-03-21 20:15:09,250 wetectron.utils.model_serialization INFO: backbone.body.features.26.bias loaded from features.26.bias of shape (512,) 2021-03-21 20:15:09,250 wetectron.utils.model_serialization INFO: backbone.body.features.26.weight loaded from features.26.weight of shape (512, 512, 3, 3) 2021-03-21 20:15:09,250 wetectron.utils.model_serialization INFO: backbone.body.features.28.bias loaded from features.28.bias of shape (512,) 2021-03-21 20:15:09,251 wetectron.utils.model_serialization INFO: backbone.body.features.28.weight loaded from features.28.weight of shape (512, 512, 3, 3) 2021-03-21 20:15:09,251 wetectron.utils.model_serialization INFO: backbone.body.features.5.bias loaded from features.5.bias of shape (128,) 2021-03-21 20:15:09,251 wetectron.utils.model_serialization INFO: backbone.body.features.5.weight loaded from features.5.weight of shape (128, 64, 3, 3) 2021-03-21 20:15:09,251 wetectron.utils.model_serialization INFO: backbone.body.features.7.bias loaded from features.7.bias of shape (128,) 2021-03-21 20:15:09,251 wetectron.utils.model_serialization INFO: backbone.body.features.7.weight loaded from features.7.weight of shape (128, 128, 3, 3) 2021-03-21 20:15:09,251 wetectron.utils.model_serialization INFO: roi_heads.feature_extractor.classifier.1.bias loaded from classifier.1.bias of shape (4096,) 2021-03-21 20:15:09,251 wetectron.utils.model_serialization INFO: roi_heads.feature_extractor.classifier.1.weight loaded from classifier.1.weight of shape (4096, 25088) 2021-03-21 20:15:09,251 wetectron.utils.model_serialization INFO: roi_heads.feature_extractor.classifier.4.bias loaded from classifier.4.bias of shape (4096,) 2021-03-21 20:15:09,251 wetectron.utils.model_serialization INFO: roi_heads.feature_extractor.classifier.4.weight loaded from classifier.4.weight of shape (4096, 4096) 2021-03-21 20:15:09,393 wetectron.data.build WARNING: When using more than one image per GPU you may encounter an out-of-memory (OOM) error if your GPU does not have sufficient memory. If this happens, you can reduce SOLVER.IMS_PER_BATCH (for training) or TEST.IMS_PER_BATCH (for inference). For training, you must also adjust the learning rate and schedule length according to the linear scaling rule. See for example: https://github.com/facebookresearch/Detectron/blob/master/configs/getting_started/tutorial_1gpu_e2e_faster_rcnn_R-50-FPN.yaml#L14 2021-03-21 20:15:10,938 wetectron.utils.miscellaneous WARNING: Dataset [ConcatDataset] has no categories attribute, labels.json file won't be created 2021-03-21 20:15:41,602 wetectron.trainer INFO: Start training

bradezard131 commented 3 years ago

The original OICR paper is 70000 steps with a decay at 40000, rather than 30000 steps with decays at 20000 and 26700

hust-lidelong commented 3 years ago

The original OICR paper is 70000 steps with a decay at 40000, rather than 30000 steps with decays at 20000 and 26700

Thanks for your reply, I will try it.

hust-lidelong commented 3 years ago

The original OICR paper is 70000 steps with decay at 40000, rather than 30000 steps with decays at 20000 and 26700

Do you have a PCL application in this codebase? I want to run PCL under this framework. Thank you

hyhyni commented 3 years ago

Nice work, but when I run this code, the result is worse. Do you know why? Thank you!

My get starte training instrunctions:

python tools/train_net.py --config-file "configs/voc/V_16_voc07.yaml" --use-tensorboard --skip-test OUTPUT_DIR output/training/ SOLVER.IMS_PER_BATCH 2 SOLVER.ITER_SIZE 1 DB.METHOD none

My INFO:

2021-03-21 20:15:01,469 wetectron INFO: Using 1 GPUs 2021-03-21 20:15:01,478 wetectron INFO: Namespace(config_file='configs/voc/V_16_voc07.yaml', distributed=False, local_rank=0, opts=['OUTPUT_DIR', 'output/training/', 'SOLVER.IMS_PER_BATCH', '2', 'SOLVER.ITER_SIZE', '1', 'DB.METHOD', 'none'], skip_test=True, use_tensorboard=True) 2021-03-21 20:15:01,478 wetectron INFO: Collecting env info (might take some time) 2021-03-21 20:15:03,539 wetectron INFO: PyTorch version: 1.6.0 Is debug build: No CUDA used to build PyTorch: 10.1

OS: Ubuntu 16.04.3 LTS GCC version: (crosstool-NG fa8859cb) 7.2.0 CMake version: version 3.11.3

Python version: 3.6 Is CUDA available: Yes CUDA runtime version: 10.1.243 GPU models and configuration: GPU 0: GeForce GTX 1080 Ti Nvidia driver version: 455.38 cuDNN version: /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn.so.7

Versions of relevant libraries: [pip3] numpy==1.16.0 [pip3] numpydoc==0.7.0 [pip3] pytorch-cns==0.3.1 [pip3] torch==1.6.0 [pip3] torchfile==0.1.0 [pip3] torchnet==0.0.4 [pip3] torchsummary==1.5.1 [pip3] torchvision==0.7.0 [conda] blas 1.0 mkl defaults [conda] cuda90 1.0 h6433d27_0 pytorch [conda] cudatoolkit 10.1.243 h6bb024c_0 defaults [conda] mkl 2018.0.0 hb491cac_4 defaults [conda] mkl-service 1.1.2 py36h17a0993_4 defaults [conda] numpy 1.13.3 py36ha266831_3 defaults [conda] numpy 1.16.0 [conda] numpydoc 0.7.0 py36h18f165f_0 defaults [conda] pytorch 1.6.0 py3.6_cuda10.1.243_cudnn7.6.3_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch [conda] pytorch-cns 0.3.1 [conda] torch 1.0.1 [conda] torch 0.3.1 [conda] torchfile 0.1.0 [conda] torchnet 0.0.4 [conda] torchsummary 1.5.1 [conda] torchvision 0.7.0 py36_cu101 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch Pillow (4.2.1) 2021-03-21 20:15:03,539 wetectron INFO: Loaded configuration file configs/voc/V_16_voc07.yaml 2021-03-21 20:15:03,540 wetectron INFO: MODEL: META_ARCHITECTURE: "GeneralizedRCNN" WEIGHT: "catalog://VGGImageNetPretrained/JCJOHNS/VGG-16" BACKBONE: CONV_BODY: "VGG16-OICR" WSOD_ON: True FASTER_RCNN: False ROI_HEADS: SCORE_THRESH: 0.0 NMS: 0.3 ROI_BOX_HEAD: NUM_CLASSES: 21 POOLER_METHOD: "ROIPool" POOLER_RESOLUTION: 7 POOLER_SCALES: (0.125,) FEATURE_EXTRACTOR: "VGG16.roi_head" ROI_WEAK_HEAD: PREDICTOR: "MISTPredictor" LOSS: "RoIRegLoss" OICR_P: 0.15 REGRESS_ON: True DB: METHOD: 'concrete' #原为'concrete' DATASETS: TRAIN: ("voc_2007_train", "voc_2007_val") TEST: ("voc_2007_test",) PROPOSAL_FILES: TRAIN: ('proposal/SS-voc_2007_train-boxes.pkl','proposal/SS-voc_2007_val-boxes.pkl') TEST: ('proposal/SS-voc_2007_test-boxes.pkl',) DATALOADER: SIZE_DIVISIBILITY: 32 INPUT: MIN_SIZE_TRAIN: (480, 576, 688, 864, 1000, 1200) MAX_SIZE_TRAIN: 2000 MIN_SIZE_TEST: 800 MAX_SIZE_TEST: 2000 SOLVER: IMS_PER_BATCH: 1 #原为8 BASE_LR: 0.01 WEIGHT_DECAY: 0.0001 WARMUP_ITERS: 200 STEPS: (20000, 26700) MAX_ITER: 30000 CHECKPOINT_PERIOD: 1000 SOLVER_CDB: BASE_LR: 0.0001 GAMMA: 3.0 WEIGHT_DECAY: 0.0001 STEPS: (20000, 26700) TEST: BBOX_AUG: ENABLED: True HEUR: "AVG" H_FLIP: True SCALES: (480, 576, 688, 864, 1000, 1200) MAX_SIZE: 2000 SCALE_H_FLIP: True SEED: 1234 2021-03-21 20:15:03,561 wetectron INFO: Running with config: AMP_VERBOSE: False DATALOADER: ASPECT_RATIO_GROUPING: True NUM_WORKERS: 4 SIZE_DIVISIBILITY: 32 DATASETS: TEST: ('voc_2007_test',) TRAIN: ('voc_2007_train', 'voc_2007_val') DB: GSM_THRES: 0.01 IS_HARD: True LR: 0.01 METHOD: none OPTIMIZER: sgd SIZE: 3 TAU: 0.3 WEIGHT: 0.01 DTYPE: float32 INPUT: BRIGHTNESS: 0.0 CONTRAST: 0.0 HUE: 0.0 MAX_SIZE_TEST: 2000 MAX_SIZE_TRAIN: 2000 MIN_SIZE_TEST: 800 MIN_SIZE_TRAIN: (480, 576, 688, 864, 1000, 1200) PCA: True PIXEL_MEAN: [102.9801, 115.9465, 122.7717] PIXEL_STD: [1.0, 1.0, 1.0] SATURATION: 0.0 TO_BGR255: True VERTICAL_FLIP_PROB_TRAIN: 0.0 MODEL: BACKBONE: CONV_BODY: VGG16-OICR FREEZE_CONV_BODY_AT: 2 CLS_AGNOSTIC_BBOX_REG: False DEVICE: cuda FASTER_RCNN: False FBNET: ARCH: default ARCH_DEF: BN_TYPE: bn DET_HEAD_BLOCKS: [] DET_HEAD_LAST_SCALE: 1.0 DET_HEAD_STRIDE: 0 DW_CONV_SKIP_BN: True DW_CONV_SKIP_RELU: True KPTS_HEAD_BLOCKS: [] KPTS_HEAD_LAST_SCALE: 0.0 KPTS_HEAD_STRIDE: 0 MASK_HEAD_BLOCKS: [] MASK_HEAD_LAST_SCALE: 0.0 MASK_HEAD_STRIDE: 0 RPN_BN_TYPE: RPN_HEAD_BLOCKS: 0 SCALE_FACTOR: 1.0 WIDTH_DIVISOR: 1 FPN: USE_GN: False USE_RELU: False GROUP_NORM: DIM_PER_GP: -1 EPSILON: 1e-05 NUM_GROUPS: 32 KEYPOINT_ON: False MASK_ON: False META_ARCHITECTURE: GeneralizedRCNN RESNETS: BACKBONE_OUT_CHANNELS: 1024 DEFORMABLE_GROUPS: 1 NUM_GROUPS: 1 RES2_OUT_CHANNELS: 256 RES5_DILATION: 1 STAGE_WITH_DCN: (False, False, False, False) STEM_FUNC: StemWithFixedBatchNorm STEM_OUT_CHANNELS: 64 STRIDE_IN_1X1: True TRANS_FUNC: BottleneckWithFixedBatchNorm WIDTH_PER_GROUP: 64 WITH_MODULATED_DCN: False RETINANET: ANCHOR_SIZES: (32, 64, 128, 256, 512) ANCHOR_STRIDES: (8, 16, 32, 64, 128) ASPECT_RATIOS: (0.5, 1.0, 2.0) BBOX_REG_BETA: 0.11 BBOX_REG_WEIGHT: 4.0 BG_IOU_THRESHOLD: 0.4 FG_IOU_THRESHOLD: 0.5 INFERENCE_TH: 0.05 LOSS_ALPHA: 0.25 LOSS_GAMMA: 2.0 NMS_TH: 0.4 NUM_CLASSES: 81 NUM_CONVS: 4 OCTAVE: 2.0 PRE_NMS_TOP_N: 1000 PRIOR_PROB: 0.01 SCALES_PER_OCTAVE: 3 STRADDLE_THRESH: 0 USE_C5: True RETINANET_ON: False ROI_BOX_HEAD: CONV_HEAD_DIM: 256 DILATION: 1 FEATURE_EXTRACTOR: VGG16.roi_head MLP_HEAD_DIM: 1024 NUM_CLASSES: 21 NUM_STACKED_CONVS: 4 POOLER_METHOD: ROIPool POOLER_RESOLUTION: 7 POOLER_SAMPLING_RATIO: 0 POOLER_SCALES: (0.125,) PREDICTOR: FastRCNNPredictor USE_GN: False ROI_HEADS: BATCH_SIZE_PER_IMAGE: 512 BBOX_REG_WEIGHTS: (10.0, 10.0, 5.0, 5.0) BG_IOU_THRESHOLD: 0.5 DETECTIONS_PER_IMG: 100 FG_IOU_THRESHOLD: 0.5 NMS: 0.3 POSITIVE_FRACTION: 0.25 SCORE_THRESH: 0.0 USE_FPN: False ROI_KEYPOINT_HEAD: CONV_LAYERS: (512, 512, 512, 512, 512, 512, 512, 512) FEATURE_EXTRACTOR: KeypointRCNNFeatureExtractor MLP_HEAD_DIM: 1024 NUM_CLASSES: 17 POOLER_RESOLUTION: 14 POOLER_SAMPLING_RATIO: 0 POOLER_SCALES: (0.0625,) PREDICTOR: KeypointRCNNPredictor RESOLUTION: 14 SHARE_BOX_FEATURE_EXTRACTOR: True ROI_MASK_HEAD: CONV_LAYERS: (256, 256, 256, 256) DILATION: 1 FEATURE_EXTRACTOR: ResNet50Conv5ROIFeatureExtractor MLP_HEAD_DIM: 1024 POOLER_RESOLUTION: 14 POOLER_SAMPLING_RATIO: 0 POOLER_SCALES: (0.0625,) POSTPROCESS_MASKS: False POSTPROCESS_MASKS_THRESHOLD: 0.5 PREDICTOR: MaskRCNNC4Predictor RESOLUTION: 14 SHARE_BOX_FEATURE_EXTRACTOR: True USE_GN: False ROI_WEAK_HEAD: CENTER_LOSS_ALPHA: 0.5 CENTER_LOSS_WEIGHT: 0.003 LOSS: RoIRegLoss OICR_P: 0.15 PARTIAL_LABELS: none PREDICTOR: MISTPredictor REGRESS_HEUR: AVG REGRESS_ON: True ROI_LOSS_REFINE: False USE_TEMPLATE: False RPN: ANCHOR_SIZES: (32, 64, 128, 256, 512) ANCHOR_STRIDE: (16,) ASPECT_RATIOS: (0.5, 1.0, 2.0) BATCH_SIZE_PER_IMAGE: 256 BG_IOU_THRESHOLD: 0.3 FG_IOU_THRESHOLD: 0.7 FPN_POST_NMS_PER_BATCH: True FPN_POST_NMS_TOP_N_TEST: 2000 FPN_POST_NMS_TOP_N_TRAIN: 2000 MIN_SIZE: 0 NMS_THRESH: 0.7 POSITIVE_FRACTION: 0.5 POST_NMS_TOP_N_TEST: 1000 POST_NMS_TOP_N_TRAIN: 2000 PRE_NMS_TOP_N_TEST: 6000 PRE_NMS_TOP_N_TRAIN: 12000 RPN_HEAD: SingleConvRPNHead STRADDLE_THRESH: 0 USE_FPN: False RPN_ONLY: False WEIGHT: catalog://VGGImageNetPretrained/JCJOHNS/VGG-16 WSOD_ON: True OUTPUT_DIR: output/training/ PATHS_CATALOG: /media/linux/学习/目标检测代码/wetectron/wetectron/config/paths_catalog.py PROPOSAL_FILES: TEST: ('proposal/SS-voc_2007_test-boxes.pkl',) TRAIN: ('proposal/SS-voc_2007_train-boxes.pkl', 'proposal/SS-voc_2007_val-boxes.pkl') SEED: 1234 SOLVER: BASE_LR: 0.01 BIAS_LR_FACTOR: 2 CHECKPOINT_PERIOD: 1000 GAMMA: 0.1 IMS_PER_BATCH: 2 ITER_SIZE: 1 MAX_ITER: 30000 MOMENTUM: 0.9 STEPS: (20000, 26700) WARMUP_FACTOR: 0.3333333333333333 WARMUP_ITERS: 200 WARMUP_METHOD: linear WEIGHT_DECAY: 0.0001 WEIGHT_DECAY_BIAS: 0 SOLVER_CDB: BASE_LR: 0.0001 BIAS_LR_FACTOR: 2 GAMMA: 3.0 MOMENTUM: 0.9 STEPS: (20000, 26700) WARMUP_FACTOR: 0.3333333333333333 WARMUP_ITERS: 500 WARMUP_METHOD: linear WEIGHT_DECAY: 0.0001 WEIGHT_DECAY_BIAS: 0 TEST: BBOX_AUG: ENABLED: True HEUR: AVG H_FLIP: True MAX_SIZE: 2000 SCALES: (480, 576, 688, 864, 1000, 1200) SCALE_H_FLIP: True DETECTIONS_PER_IMG: 100 EXPECTED_RESULTS: [] EXPECTED_RESULTS_SIGMA_TOL: 4 IMS_PER_BATCH: 8 VIS_THRES: 0.5 2021-03-21 20:15:03,562 wetectron INFO: Saving config into: output/training/config.yml 2021-03-21 20:15:07,640 wetectron.utils.checkpoint INFO: Loading checkpoint from catalog://VGGImageNetPretrained/JCJOHNS/VGG-16 2021-03-21 20:15:07,659 wetectron.utils.checkpoint INFO: catalog://VGGImageNetPretrained/JCJOHNS/VGG-16 points to https://web.eecs.umich.edu/~justincj/models/vgg16-00b39a1b.pth 2021-03-21 20:15:07,659 wetectron.utils.checkpoint INFO: url https://web.eecs.umich.edu/~justincj/models/vgg16-00b39a1b.pth cached in /home/linux/.torch/models/vgg16-00b39a1b.pth 2021-03-21 20:15:09,249 wetectron.utils.model_serialization INFO: backbone.body.features.0.bias loaded from features.0.bias of shape (64,) 2021-03-21 20:15:09,249 wetectron.utils.model_serialization INFO: backbone.body.features.0.weight loaded from features.0.weight of shape (64, 3, 3, 3) 2021-03-21 20:15:09,249 wetectron.utils.model_serialization INFO: backbone.body.features.10.bias loaded from features.10.bias of shape (256,) 2021-03-21 20:15:09,249 wetectron.utils.model_serialization INFO: backbone.body.features.10.weight loaded from features.10.weight of shape (256, 128, 3, 3) 2021-03-21 20:15:09,249 wetectron.utils.model_serialization INFO: backbone.body.features.12.bias loaded from features.12.bias of shape (256,) 2021-03-21 20:15:09,249 wetectron.utils.model_serialization INFO: backbone.body.features.12.weight loaded from features.12.weight of shape (256, 256, 3, 3) 2021-03-21 20:15:09,249 wetectron.utils.model_serialization INFO: backbone.body.features.14.bias loaded from features.14.bias of shape (256,) 2021-03-21 20:15:09,249 wetectron.utils.model_serialization INFO: backbone.body.features.14.weight loaded from features.14.weight of shape (256, 256, 3, 3) 2021-03-21 20:15:09,249 wetectron.utils.model_serialization INFO: backbone.body.features.17.bias loaded from features.17.bias of shape (512,) 2021-03-21 20:15:09,250 wetectron.utils.model_serialization INFO: backbone.body.features.17.weight loaded from features.17.weight of shape (512, 256, 3, 3) 2021-03-21 20:15:09,250 wetectron.utils.model_serialization INFO: backbone.body.features.19.bias loaded from features.19.bias of shape (512,) 2021-03-21 20:15:09,250 wetectron.utils.model_serialization INFO: backbone.body.features.19.weight loaded from features.19.weight of shape (512, 512, 3, 3) 2021-03-21 20:15:09,250 wetectron.utils.model_serialization INFO: backbone.body.features.2.bias loaded from features.2.bias of shape (64,) 2021-03-21 20:15:09,250 wetectron.utils.model_serialization INFO: backbone.body.features.2.weight loaded from features.2.weight of shape (64, 64, 3, 3) 2021-03-21 20:15:09,250 wetectron.utils.model_serialization INFO: backbone.body.features.21.bias loaded from features.21.bias of shape (512,) 2021-03-21 20:15:09,250 wetectron.utils.model_serialization INFO: backbone.body.features.21.weight loaded from features.21.weight of shape (512, 512, 3, 3) 2021-03-21 20:15:09,250 wetectron.utils.model_serialization INFO: backbone.body.features.24.bias loaded from features.24.bias of shape (512,) 2021-03-21 20:15:09,250 wetectron.utils.model_serialization INFO: backbone.body.features.24.weight loaded from features.24.weight of shape (512, 512, 3, 3) 2021-03-21 20:15:09,250 wetectron.utils.model_serialization INFO: backbone.body.features.26.bias loaded from features.26.bias of shape (512,) 2021-03-21 20:15:09,250 wetectron.utils.model_serialization INFO: backbone.body.features.26.weight loaded from features.26.weight of shape (512, 512, 3, 3) 2021-03-21 20:15:09,250 wetectron.utils.model_serialization INFO: backbone.body.features.28.bias loaded from features.28.bias of shape (512,) 2021-03-21 20:15:09,251 wetectron.utils.model_serialization INFO: backbone.body.features.28.weight loaded from features.28.weight of shape (512, 512, 3, 3) 2021-03-21 20:15:09,251 wetectron.utils.model_serialization INFO: backbone.body.features.5.bias loaded from features.5.bias of shape (128,) 2021-03-21 20:15:09,251 wetectron.utils.model_serialization INFO: backbone.body.features.5.weight loaded from features.5.weight of shape (128, 64, 3, 3) 2021-03-21 20:15:09,251 wetectron.utils.model_serialization INFO: backbone.body.features.7.bias loaded from features.7.bias of shape (128,) 2021-03-21 20:15:09,251 wetectron.utils.model_serialization INFO: backbone.body.features.7.weight loaded from features.7.weight of shape (128, 128, 3, 3) 2021-03-21 20:15:09,251 wetectron.utils.model_serialization INFO: roi_heads.feature_extractor.classifier.1.bias loaded from classifier.1.bias of shape (4096,) 2021-03-21 20:15:09,251 wetectron.utils.model_serialization INFO: roi_heads.feature_extractor.classifier.1.weight loaded from classifier.1.weight of shape (4096, 25088) 2021-03-21 20:15:09,251 wetectron.utils.model_serialization INFO: roi_heads.feature_extractor.classifier.4.bias loaded from classifier.4.bias of shape (4096,) 2021-03-21 20:15:09,251 wetectron.utils.model_serialization INFO: roi_heads.feature_extractor.classifier.4.weight loaded from classifier.4.weight of shape (4096, 4096) 2021-03-21 20:15:09,393 wetectron.data.build WARNING: When using more than one image per GPU you may encounter an out-of-memory (OOM) error if your GPU does not have sufficient memory. If this happens, you can reduce SOLVER.IMS_PER_BATCH (for training) or TEST.IMS_PER_BATCH (for inference). For training, you must also adjust the learning rate and schedule length according to the linear scaling rule. See for example: https://github.com/facebookresearch/Detectron/blob/master/configs/getting_started/tutorial_1gpu_e2e_faster_rcnn_R-50-FPN.yaml#L14 2021-03-21 20:15:10,938 wetectron.utils.miscellaneous WARNING: Dataset [ConcatDataset] has no categories attribute, labels.json file won't be created 2021-03-21 20:15:41,602 wetectron.trainer INFO: Start training

Hello, I want to run oicr on this code, How should I modify the configuration file?

jason718 commented 3 years ago

This is not an official implementation of OICR. Please refer to their official code base if you want to use it.

A old config file that I can find is:

MODEL:
  META_ARCHITECTURE: "GeneralizedRCNN"
  WEIGHT: "catalog://VGGImageNetPretrained/JCJOHNS/VGG-16"
  BACKBONE:
    CONV_BODY: "VGG16-OICR"
  WSOD_ON: True
  FASTER_RCNN: False
  ROI_HEADS:
    SCORE_THRESH: 0.0
    NMS: 0.3
  ROI_BOX_HEAD:
    NUM_CLASSES: 21
    POOLER_METHOD: "ROIPool"
    POOLER_RESOLUTION: 7
    POOLER_SCALES: (0.125,)
    FEATURE_EXTRACTOR: "VGG16.roi_head"
  ROI_WEAK_HEAD:
    PREDICTOR: "OICRPredictor"
    LOSS: "RoILoss"
DB:
  METHOD: 'none'
DATASETS:
  TRAIN: ("voc_2007_train", "voc_2007_val")
  TEST: ("voc_2007_test",)
PROPOSAL_FILES:
  TRAIN: ('proposal/SS-voc_2007_train-boxes.pkl','proposal/SS-voc_2007_val-boxes.pkl')
  TEST:  ('proposal/SS-voc_2007_test-boxes.pkl',)
DATALOADER:
  SIZE_DIVISIBILITY: 32
INPUT:
  MIN_SIZE_TRAIN: (480, 576, 688, 864, 1000, 1200) 
  MAX_SIZE_TRAIN: 2000
  MIN_SIZE_TEST: 800
  MAX_SIZE_TEST: 2000
SOLVER:
  IMS_PER_BATCH: 8
  BASE_LR: 0.01
  WEIGHT_DECAY: 0.0001
  STEPS: (12500, 17500)
  MAX_ITER: 20000
  CHECKPOINT_PERIOD: 5000
TEST:
  BBOX_AUG:
    ENABLED: True
    HEUR: "AVG"
    H_FLIP: True
    SCALES: (480, 576, 688, 864, 1000, 1200) 
    MAX_SIZE: 2000
    SCALE_H_FLIP: True

Again, no guarantee this will fully reproduce.