Commit d9c04ecc authored by Yanghao Li's avatar Yanghao Li Committed by Facebook GitHub Bot
Browse files

support square padding in backbone

Summary:
Pull Request resolved: https://github.com/facebookresearch/d2go/pull/258

Support square padding case in backbone.

Reviewed By: wat3rBro

Differential Revision: D35552076

fbshipit-source-id: e4f7f4da62b6ee9b71686071ff6cf2747ecc90e0
parent 56243caa
......@@ -203,7 +203,7 @@ def _fx_quant_prepare(self, cfg):
self.backbone,
qconfig,
prepare_custom_config_dict={
"preserved_attributes": ["size_divisibility"],
"preserved_attributes": ["size_divisibility", "padding_constraints"],
# keep the output of backbone quantized, to avoid
# redundant dequant
# TODO: output of backbone is a dict and currently this will keep all output
......@@ -285,7 +285,9 @@ def default_rcnn_prepare_for_quant_convert(self, cfg):
assert not isinstance(self.backbone, FPN), "FPN is not supported in FX mode"
self.backbone = convert_fx(
self.backbone,
convert_custom_config_dict={"preserved_attributes": ["size_divisibility"]},
convert_custom_config_dict={
"preserved_attributes": ["size_divisibility", "padding_constraints"]
},
)
self.proposal_generator.rpn_head.rpn_feature = convert_fx(
self.proposal_generator.rpn_head.rpn_feature
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment