Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model weights might be out of date? #172

Open
hansihe opened this issue Feb 4, 2022 · 1 comment
Open

Model weights might be out of date? #172

hansihe opened this issue Feb 4, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@hansihe
Copy link

hansihe commented Feb 4, 2022

I am on 6791682.

Running the following code:

runner = GeneralizedRCNNRunner()
cfg = runner.get_default_cfg()

cfg.merge_from_file("/content/faster_rcnn_fbnetv3a_C4.yaml") # This is the config file from the same revision, just working around an issue with colab.
cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.5
cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url("faster_rcnn_fbnetv3a_C4.yaml")

predictor = DefaultPredictor(cfg)

Gives the following output:

INFO:d2go.modeling.backbone.fbnet_v2:Build FBNet using unified arch_def:
trunk
- {'block_op': 'conv_k3', 'block_cfg': {'out_channels': 16, 'stride': 2}, 'stage_idx': 0, 'block_idx': 0}
- {'block_op': 'ir_k3', 'block_cfg': {'out_channels': 16, 'stride': 1, 'expansion': 1, 'less_se_channels': False}, 'stage_idx': 0, 'block_idx': 1}
- {'block_op': 'ir_k3', 'block_cfg': {'out_channels': 16, 'stride': 1, 'expansion': 1, 'less_se_channels': False}, 'stage_idx': 0, 'block_idx': 2}
- {'block_op': 'ir_k5', 'block_cfg': {'out_channels': 24, 'stride': 2, 'expansion': 4, 'less_se_channels': False}, 'stage_idx': 1, 'block_idx': 0}
- {'block_op': 'ir_k5', 'block_cfg': {'out_channels': 24, 'stride': 1, 'expansion': 3, 'less_se_channels': False}, 'stage_idx': 1, 'block_idx': 1}
- {'block_op': 'ir_k5', 'block_cfg': {'out_channels': 24, 'stride': 1, 'expansion': 3, 'less_se_channels': False}, 'stage_idx': 1, 'block_idx': 2}
- {'block_op': 'ir_k5', 'block_cfg': {'out_channels': 24, 'stride': 1, 'expansion': 3, 'less_se_channels': False}, 'stage_idx': 1, 'block_idx': 3}
- {'block_op': 'ir_k5_se', 'block_cfg': {'out_channels': 32, 'stride': 2, 'expansion': 4, 'less_se_channels': False}, 'stage_idx': 2, 'block_idx': 0}
- {'block_op': 'ir_k3_se', 'block_cfg': {'out_channels': 32, 'stride': 1, 'expansion': 3, 'less_se_channels': False}, 'stage_idx': 2, 'block_idx': 1}
- {'block_op': 'ir_k3_se', 'block_cfg': {'out_channels': 32, 'stride': 1, 'expansion': 3, 'less_se_channels': False}, 'stage_idx': 2, 'block_idx': 2}
- {'block_op': 'ir_k3_se', 'block_cfg': {'out_channels': 32, 'stride': 1, 'expansion': 3, 'less_se_channels': False}, 'stage_idx': 2, 'block_idx': 3}
- {'block_op': 'ir_k5', 'block_cfg': {'out_channels': 64, 'stride': 2, 'expansion': 4, 'less_se_channels': False}, 'stage_idx': 3, 'block_idx': 0}
- {'block_op': 'ir_k3', 'block_cfg': {'out_channels': 64, 'stride': 1, 'expansion': 3, 'less_se_channels': False}, 'stage_idx': 3, 'block_idx': 1}
- {'block_op': 'ir_k3', 'block_cfg': {'out_channels': 64, 'stride': 1, 'expansion': 3, 'less_se_channels': False}, 'stage_idx': 3, 'block_idx': 2}
- {'block_op': 'ir_k3', 'block_cfg': {'out_channels': 64, 'stride': 1, 'expansion': 3, 'less_se_channels': False}, 'stage_idx': 3, 'block_idx': 3}
- {'block_op': 'ir_k5_se', 'block_cfg': {'out_channels': 112, 'stride': 1, 'expansion': 4, 'less_se_channels': False}, 'stage_idx': 3, 'block_idx': 4}
- {'block_op': 'ir_k5_se', 'block_cfg': {'out_channels': 112, 'stride': 1, 'expansion': 3, 'less_se_channels': False}, 'stage_idx': 3, 'block_idx': 5}
- {'block_op': 'ir_k5_se', 'block_cfg': {'out_channels': 112, 'stride': 1, 'expansion': 3, 'less_se_channels': False}, 'stage_idx': 3, 'block_idx': 6}
- {'block_op': 'ir_k5_se', 'block_cfg': {'out_channels': 112, 'stride': 1, 'expansion': 3, 'less_se_channels': False}, 'stage_idx': 3, 'block_idx': 7}
- {'block_op': 'ir_k5_se', 'block_cfg': {'out_channels': 112, 'stride': 1, 'expansion': 3, 'less_se_channels': False}, 'stage_idx': 3, 'block_idx': 8}
- {'block_op': 'ir_k5_se', 'block_cfg': {'out_channels': 112, 'stride': 1, 'expansion': 3, 'less_se_channels': False}, 'stage_idx': 3, 'block_idx': 9}
WARNING:mobile_cv.arch.utils.helper:Arguments ['width_divisor', 'dw_skip_bnrelu', 'zero_last_bn_gamma'] skipped for op Conv2d
INFO:d2go.modeling.backbone.fbnet_v2:Build FBNet using unified arch_def:
rpn
- {'block_op': 'ir_k5_se', 'block_cfg': {'out_channels': 112, 'stride': 1, 'expansion': 3, 'less_se_channels': False}, 'stage_idx': 0, 'block_idx': 0}
- {'block_op': 'ir_k5_se', 'block_cfg': {'out_channels': 112, 'stride': 1, 'expansion': 3, 'less_se_channels': False}, 'stage_idx': 0, 'block_idx': 1}
- {'block_op': 'ir_k5_se', 'block_cfg': {'out_channels': 112, 'stride': 1, 'expansion': 3, 'less_se_channels': False}, 'stage_idx': 0, 'block_idx': 2}
- {'block_op': 'ir_k5_se', 'block_cfg': {'out_channels': 112, 'stride': 1, 'expansion': 3, 'less_se_channels': False}, 'stage_idx': 0, 'block_idx': 3}
- {'block_op': 'ir_k5_se', 'block_cfg': {'out_channels': 112, 'stride': 1, 'expansion': 3, 'less_se_channels': False}, 'stage_idx': 0, 'block_idx': 4}
INFO:d2go.modeling.backbone.fbnet_v2:Build FBNet using unified arch_def:
bbox
- {'block_op': 'ir_k5_se', 'block_cfg': {'out_channels': 184, 'stride': 2, 'expansion': 4, 'less_se_channels': False}, 'stage_idx': 0, 'block_idx': 0}
- {'block_op': 'ir_k3_se', 'block_cfg': {'out_channels': 184, 'stride': 1, 'expansion': 4, 'less_se_channels': False}, 'stage_idx': 0, 'block_idx': 1}
- {'block_op': 'ir_k3_se', 'block_cfg': {'out_channels': 184, 'stride': 1, 'expansion': 4, 'less_se_channels': False}, 'stage_idx': 0, 'block_idx': 2}
- {'block_op': 'ir_k3_se', 'block_cfg': {'out_channels': 184, 'stride': 1, 'expansion': 4, 'less_se_channels': False}, 'stage_idx': 0, 'block_idx': 3}
- {'block_op': 'ir_k3_se', 'block_cfg': {'out_channels': 184, 'stride': 1, 'expansion': 4, 'less_se_channels': False}, 'stage_idx': 0, 'block_idx': 4}
- {'block_op': 'ir_k5_se', 'block_cfg': {'out_channels': 200, 'stride': 1, 'expansion': 6, 'less_se_channels': False}, 'stage_idx': 0, 'block_idx': 5}
INFO:fvcore.common.checkpoint:[Checkpointer] Loading from https://mobile-cv.s3-us-west-2.amazonaws.com/d2go/models/268421013/model_final.pth ...
WARNING:fvcore.common.checkpoint:The checkpoint state_dict contains keys that are not used by the model:
  roi_heads.mask_head.feature_extractor.0.fbnetv2_0_0.pw.conv.weight
  roi_heads.mask_head.feature_extractor.0.fbnetv2_0_0.pw.bn.{bias, num_batches_tracked, running_mean, running_var, weight}
  roi_heads.mask_head.feature_extractor.0.fbnetv2_0_0.dw.conv.weight
  roi_heads.mask_head.feature_extractor.0.fbnetv2_0_0.pwl.conv.weight
  roi_heads.mask_head.feature_extractor.0.fbnetv2_0_0.pwl.bn.{bias, num_batches_tracked, running_mean, running_var, weight}
  roi_heads.mask_head.feature_extractor.0.fbnetv2_0_1.pw.conv.weight
  roi_heads.mask_head.feature_extractor.0.fbnetv2_0_1.pw.bn.{bias, num_batches_tracked, running_mean, running_var, weight}
  roi_heads.mask_head.feature_extractor.0.fbnetv2_0_1.dw.conv.weight
  roi_heads.mask_head.feature_extractor.0.fbnetv2_0_1.pwl.conv.weight
  roi_heads.mask_head.feature_extractor.0.fbnetv2_0_1.pwl.bn.{bias, num_batches_tracked, running_mean, running_var, weight}
  roi_heads.mask_head.feature_extractor.0.fbnetv2_0_2.pw.conv.weight
  roi_heads.mask_head.feature_extractor.0.fbnetv2_0_2.pw.bn.{bias, num_batches_tracked, running_mean, running_var, weight}
  roi_heads.mask_head.feature_extractor.0.fbnetv2_0_2.dw.conv.weight
  roi_heads.mask_head.feature_extractor.0.fbnetv2_0_2.pwl.conv.weight
  roi_heads.mask_head.feature_extractor.0.fbnetv2_0_2.pwl.bn.{bias, num_batches_tracked, running_mean, running_var, weight}
  roi_heads.mask_head.feature_extractor.0.fbnetv2_0_3.pw.conv.weight
  roi_heads.mask_head.feature_extractor.0.fbnetv2_0_3.pw.bn.{bias, num_batches_tracked, running_mean, running_var, weight}
  roi_heads.mask_head.feature_extractor.0.fbnetv2_0_3.dw.conv.weight
  roi_heads.mask_head.feature_extractor.0.fbnetv2_0_3.pwl.conv.weight
  roi_heads.mask_head.feature_extractor.0.fbnetv2_0_3.pwl.bn.{bias, num_batches_tracked, running_mean, running_var, weight}
  roi_heads.mask_head.feature_extractor.0.fbnetv2_0_4.pw.conv.weight
  roi_heads.mask_head.feature_extractor.0.fbnetv2_0_4.pw.bn.{bias, num_batches_tracked, running_mean, running_var, weight}
  roi_heads.mask_head.feature_extractor.0.fbnetv2_0_4.dw.conv.weight
  roi_heads.mask_head.feature_extractor.0.fbnetv2_0_4.pwl.conv.weight
  roi_heads.mask_head.feature_extractor.0.fbnetv2_0_4.pwl.bn.{bias, num_batches_tracked, running_mean, running_var, weight}
  roi_heads.mask_head.predictor.mask_fcn_logits.{bias, weight}

As I understand it the last couple of times an error like this has occurred it has been an issue with out of date weights, could this be the case here as well?

@hansihe hansihe added the bug Something isn't working label Feb 4, 2022
@wat3rBro
Copy link
Contributor

wat3rBro commented Mar 6, 2022

It's loading a maskrcnn weight file into a faster-rcnn model, as you can see the un-used parameters are all starting with "roi_heads".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants