-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Adding multiweight support to Quantized GoogLeNet #4848
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
Adding multiweight support to Quantized GoogLeNet #4848
Conversation
💊 CI failures summary and remediationsAs of commit 1a150d9 (more details on the Dr. CI page):
1 failure not recognized by patterns:
1 job timed out:
This comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments to assist review:
@@ -84,6 +84,7 @@ def test_old_vs_new_factory(model_fn, module_name, dev): | |||
}, | |||
"quantization": { | |||
"input_shape": (1, 3, 224, 224), | |||
"quantize": True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed to actually run the tests on the quantized weights.
progress: bool = True, | ||
quantize: bool = False, | ||
**kwargs: Any, | ||
) -> "QuantizableGoogLeNet": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just moving this builder below to the class definition to use proper typing.
progress: bool = True, | ||
quantize: bool = False, | ||
**kwargs: Any, | ||
) -> QuantizableGoogLeNet: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy-pasted, no need for review.
@@ -14,14 +14,13 @@ | |||
|
|||
|
|||
class GoogLeNetWeights(Weights): | |||
ImageNet1K_Community = WeightEntry( | |||
ImageNet1K_TFV1 = WeightEntry( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was previously incorrectly tagged as community contribution while in reality the weights were ported from TF. Proof: #678 (comment)
else: | ||
weights = GoogLeNetWeights.verify(weights) | ||
|
||
original_aux_logits = kwargs.get("aux_logits", False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We simplify similarly to the unquantized builder.
kwargs["num_classes"] = len(weights.meta["categories"]) | ||
if "backend" in weights.meta: | ||
kwargs["backend"] = weights.meta["backend"] | ||
backend = kwargs.pop("backend", "fbgemm") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest is similar to the quantized implementation for resnet.
"backend": "fbgemm", | ||
"quantization": "ptq", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding some additional meta-data such as interpolation, type of quantization and a reference to the unquantized enum of the the weights to all previous models.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Summary: * Reordering the builders to use proper typing. * Adding additional meta-data on existing quantized models. * Fixing meta on unquantized model. * Adding quantized googlenet builder. * undo inception move. * Adding recipe information. Reviewed By: kazhang Differential Revision: D32216660 fbshipit-source-id: 2fbda7b7d39e97f156264b86fcf42076598d564b
* Reordering the builders to use proper typing. * Adding additional meta-data on existing quantized models. * Fixing meta on unquantized model. * Adding quantized googlenet builder. * undo inception move. * Adding recipe information.
Fixes partially #4674
Verified with:
cc @bjuncek