Post-paper Detection Optimizations#5444
Conversation
💊 CI failures summary and remediationsAs of commit 6488c41 (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
2bc1e81 to
bcf0afc
Compare
fmassa
left a comment
There was a problem hiding this comment.
LGTM!
I've left just a minor comment regarding naming, but it's just for discussion and there is no need to act on it
|
@datumbox I'm getting errors when trying to load a model using FPN as a frozen layer. This seems to be a regression since PT 1.11 stable and I can no longer save/load my model. Excluding the semantic weights when calling torch.load doesn't help either. My model has |
|
Adding a version = local_metadata.get("version", None)
if version is None or version < 2:
for type in ["weight", "bias"]:
old_key = f"{prefix}conv.{type}"
new_key = f"{prefix}conv.0.0.{type}"
+ if old_key in state_dict:
state_dict[new_key] = state_dict.pop(old_key) |
|
@d4l3k Thanks for the heads up.
If this is true, it's probably not related to this PR. To reduce any confusion, could you please open a separate issue and provide a way to reproduce the problem?
This might indicate that the old structure is modified and not compatible with v1. The proposed patch is not a solution but rather more likely to mask the issue. If you provide a way to reproduce the issue, we can help you invstigate. |
Summary: * Use frozen BN only if pre-trained. * Add LSJ and ability to from scratch training. * Fixing formatter * Adding `--opt` and `--norm-weight-decay` support in Detection. * Fix error message * Make ScaleJitter proportional. * Adding more norm layers in split_normalization_params. * Add FixedSizeCrop * Temporary fix for fill values on PIL * Fix the bug on fill. * Add RandomShortestSize. * Skip resize when an augmentation method is used. * multiscale in [480, 800] * Add missing star * Add new RetinaNet variant. * Add tests. * Update expected file for old retina * Fixing tests * Add FrozenBN to retinav2 * Fix network initialization issues * Adding BN support in MaskRCNNHeads and FPN * Adding support of FasterRCNNHeads * Introduce norm_layers in backbone utils. * Bigger RPN head + 2x rcnn v2 models. * Adding gIoU support to retinanet * Fix assert * Add back nesterov momentum * Rename and extend `FastRCNNConvFCHead` to support arbitrary FCs * Fix linter (Note: this ignores all push blocking failures!) Reviewed By: jdsgomes, NicolasHug Differential Revision: D36095683 fbshipit-source-id: 9105524308694ac8830ed12ba40286bb75c4aa8d
Related to #5307 and #2263. Touches upon requests recorded at #4932 and #5325.
Our target is to improve the existing RetinaNet, FasterRCNN and MaskRCNN architectures using post-paper optimizations:
This PR contains commits which were later split on separate PRs to assist the reviews. Currently it contains the following changes on top of the main branch:
norm_layerin all Detection heads.FastRCNNConvFCHeadwhich follows a similar strategy as the existingMaskRCNNHeads.Conv2dNormActivationwhere possible; we use PyTorch core's_load_from_state_dict()approach to maintain BC.RPNHeadto support heavier heads._box_lossutility which allows for training models with different box losses. No plans to make this public; the entire API is kept private so that we can review our Detection API as a whole and examine the best way to support different Transforms and Losses in Detection models.