我们如何在keras中加载caffe2预训练模型?

时间:2019-12-16 13:23:00

标签: python-3.x tensorflow keras caffe2

我在caffe2中的.pkl扩展名中具有maskrcnn的预训练权重,并且它的配置文件为yaml。如果我尝试直接加载它,则会抛出Improper config format:。有没有不用安装caffe2就可以使用它的方法。

Config.py

MODEL:
  TYPE: generalized_rcnn
  CONV_BODY: FPN.add_fpn_ResNet101_conv5_body
  NUM_CLASSES: 6
  FASTER_RCNN: True
  MASK_ON: True
NUM_GPUS: 8
SOLVER:
  WEIGHT_DECAY: 0.0001
  LR_POLICY: steps_with_decay
  # 1x schedule (note TRAIN.IMS_PER_BATCH: 1)
  BASE_LR: 0.01
  GAMMA: 0.1
  MAX_ITER: 180000
  STEPS: [0, 120000, 160000]
FPN:
  FPN_ON: True
  MULTILEVEL_ROIS: True
  MULTILEVEL_RPN: True
MRCNN:
  ROI_MASK_HEAD: mask_rcnn_heads.mask_rcnn_fcn_head_v1up4convs
  RESOLUTION: 28  # (output mask resolution) default 14
  ROI_XFORM_METHOD: RoIAlign
  ROI_XFORM_RESOLUTION: 14  # default 7
  ROI_XFORM_SAMPLING_RATIO: 2  # default 0
  DILATION: 1  # default 2
  CONV_INIT: MSRAFill  # default GaussianFill
TRAIN:
  # md5sum of weights pkl file: aa14062280226e48f569ef1c7212e7c7
  DATASETS: ('medline_train',)
  SCALES: (400,)
  MAX_SIZE: 512
  IMS_PER_BATCH: 1
  BATCH_SIZE_PER_IM: 512
  RPN_PRE_NMS_TOP_N: 2000  # Per FPN level
  USE_FLIPPED: False
TEST:
  DATASETS: ('medline_val',)
  SCALE: 400
  MAX_SIZE: 512
  NMS: 0.5
  RPN_PRE_NMS_TOP_N: 1000  # Per FPN level
  RPN_POST_NMS_TOP_N: 1000
  FORCE_JSON_DATASET_EVAL: True
OUTPUT_DIR: .

0 个答案:

没有答案