KaihuaTang / Scene-Graph-Benchmark.pytorch

A new codebase for popular Scene Graph Generation methods (2020). Visualization & Scene Graph Extraction on custom images/datasets are provided. It's also a PyTorch implementation of paper “Unbiased Scene Graph Generation from Biased Training CVPR 2020”
MIT License
1.03k stars 228 forks source link

How to pretrain Faster RCNN with VGG-16 and no FPN? #122

Open stevehuanghe opened 3 years ago

stevehuanghe commented 3 years ago

Hello,

Could you please share the config file and command for training Faster RCNN with VGG-16 as backbone and no FPN used? I tried to train it but the program outputs NAN losses.

The config I used was:

MODEL:
  META_ARCHITECTURE: "GeneralizedRCNN"
  BACKBONE:
    CONV_BODY: "VGG-16" #   R-101-FPN
  RESNETS:
    BACKBONE_OUT_CHANNELS: 512
  RELATION_ON: True
  ATTRIBUTE_ON: False
  FLIP_AUG: False            # if there is any left-right relation, FLIP AUG should be false
  RPN:
    USE_FPN: False
    ANCHOR_SIZES: (32, 64, 128, 256, 512)
    ANCHOR_STRIDE: (16, )
    ASPECT_RATIOS: (0.23232838, 0.63365731, 1.28478321, 3.15089189)   # from neural-motifs
    PRE_NMS_TOP_N_TRAIN: 6000
    PRE_NMS_TOP_N_TEST: 6000
    POST_NMS_TOP_N_TRAIN: 1000
    POST_NMS_TOP_N_TEST: 1000
    FPN_POST_NMS_TOP_N_TRAIN: 1000
    FPN_POST_NMS_TOP_N_TEST: 1000
    FPN_POST_NMS_PER_BATCH: False
    RPN_MID_CHANNEL: 512
  ROI_HEADS:
    USE_FPN: False
    POSITIVE_FRACTION: 0.5
    BG_IOU_THRESHOLD: 0.3
    BATCH_SIZE_PER_IMAGE: 256
    DETECTIONS_PER_IMG: 80
    NMS_FILTER_DUPLICATES: True

and the command I used was

CUDA_VISIBLE_DEVICES=2 python tools/detector_pretrain_net.py \
--config-file "configs/e2e_relation_vgg16.yaml" \
SOLVER.IMS_PER_BATCH 4 TEST.IMS_PER_BATCH 2 DTYPE "float32" \
SOLVER.MAX_ITER 50000 SOLVER.STEPS "(30000, 45000)" SOLVER.VAL_PERIOD 2000 \
SOLVER.CHECKPOINT_PERIOD 2000 MODEL.RELATION_ON False \
OUTPUT_DIR ./checkpoints/pretrained_faster_rcnn_vgg16 \
SOLVER.PRE_VAL False \
SOLVER.SCHEDULE.TYPE "WarmupMultiStepLR" \
SOLVER.BASE_LR 0.0025

Thank you very much~