Skip to content

Commit

Permalink
updated the head and hyperparameters
Browse files Browse the repository at this point in the history
  • Loading branch information
iKrishneel committed May 23, 2021
1 parent b4bfc3a commit 21771bb
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
1 change: 1 addition & 0 deletions efficient_net_v2/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ def main(args):
register_dataset(dataset_name='coco_2017_val_20', is_train=False)

trainer = Trainer(cfg)

# trainer = DefaultTrainer(cfg)
trainer.resume_or_load(resume=args.resume)
return trainer.train()
Expand Down
34 changes: 22 additions & 12 deletions efficient_net_v2/config/effnet_coco.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,17 @@ MODEL:
IN_FEATURES: ["s2", "s3", "s5", "s6"]
RPN:
IN_FEATURES: ["p2", "p3", "p4", "p5"]
PRE_NMS_TOPK_TRAIN: 12000
POST_NMS_TOPK_TRAIN: 1000
PRE_NMS_TOPK_TRAIN: 2000
POST_NMS_TOPK_TRAIN: 1000
CONV_DIMS: [256, 512, 256]
PROPOSAL_GENERATOR:
NAME: "RPN"
NAME: "RPN"
MIN_SIZE: 4
ANCHOR_GENERATOR:
SIZES: [[32], [64], [256], [512]]
ASPECT_RATIOS: [[0.5, 1.0, 2.0]]
RETINANET:
NUM_CLASSES: &num_classes 20
NUM_CLASSES: &num_classes 80
IOU_THRESHOLDS: [0.4, 0.5]
IOU_LABELS: [0, -1, 1]
SMOOTH_L1_LOSS_BETA: 0.0
Expand All @@ -26,8 +31,8 @@ MODEL:
NAME: "StandardROIHeads"
ROI_BOX_HEAD:
NAME: "FastRCNNConvFCHead"
NUM_FC: 2
NUM_CONV: 1
NUM_FC: 0
NUM_CONV: 3
NORM: ""
POOLER_RESOLUTION: 7
ROI_MASK_HEAD:
Expand All @@ -41,19 +46,24 @@ MODEL:
SEM_SEG_HEAD:
NUM_CLASSES: *num_classes
MASK_ON: False
LOAD_PROPOSALS: False
LOAD_PROPOSALS: False
WEIGHTS: ""
SOLVER:
IMS_PER_BATCH: 12
BASE_LR: 0.0005
STEPS: (60000, 800000)
AMP:
ENABLED: True
IMS_PER_BATCH: 20
BASE_LR: 0.02
STEPS: (30000, 60000)
MAX_ITER: 100000
NESTEROV: False
WARMUP_ITERS: 0
CHECKPOINT_PERIOD: 5000
DATALOADER:
NUM_WORKERS: 8
DATASETS:
TRAIN: ("coco_2017_train_20", )
TEST: ("coco_2017_val_20", )
TRAIN: ("coco_2017_train", )
TEST: ("coco_2017_val", )
# PROPOSAL_FILES_TRAIN: ("detectron2://COCO-Detection/rpn_R_50_FPN_1x/137258492/coco_2017_train_box_proposals_21bc3a.pkl", )
# PROPOSAL_FILES_TEST: ("detectron2://COCO-Detection/rpn_R_50_FPN_1x/137258492/coco_2017_val_box_proposals_ee0dad.pkl", )
# TRAIN: ("penn_fudan", )
# TEST: ("penn_fudan_test",)
6 changes: 3 additions & 3 deletions efficient_net_v2/datasets/coco_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

logger = logging.getLogger(__name__)

__labels__ = (
LABELS = (
'aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus',
'car', 'cat', 'chair', 'cow', 'diningtable', 'dog',
'horse', 'motorbike', 'person', 'pottedplant', 'sheep',
Expand All @@ -35,7 +35,7 @@ def __post_init__(self):
self.class_label = {}
self.match_index = {}
for i, line in enumerate(lines, 1):
if line not in __labels__:
if line not in LABELS:
continue
self.class_label[line] = i
self.match_index[i] = [len(self.match_index) + 1, line]
Expand Down Expand Up @@ -68,6 +68,6 @@ def __call__(self):

import sys
c = CocoDataset(coco_names=sys.argv[1])

import IPython
IPython.embed()
1 change: 0 additions & 1 deletion efficient_net_v2/model/backbone.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def output_shape(self):
}

def forward(self, x):
# return {'stage7': super().forward(x)}
features = self.stage_forward(x)
return {
name: features[name] for name in self.out_features
Expand Down

0 comments on commit 21771bb

Please sign in to comment.