mobilenet_v2¶
- torchvision.models.quantization.mobilenet_v2(*, weights: Optional[Union[MobileNet_V2_QuantizedWeights, MobileNet_V2_Weights]] = None, progress: bool = True, quantize: bool = False, **kwargs: Any) QuantizableMobileNetV2[source]¶
Constructs a MobileNetV2 architecture from MobileNetV2: Inverted Residuals and Linear Bottlenecks.
Note
Note that
quantize = Truereturns a quantized model with 8 bit weights. Quantized models only support inference and run on CPUs. GPU inference is not yet supported.- Parameters:
weights (
MobileNet_V2_QuantizedWeightsorMobileNet_V2_Weights, optional) – The pretrained weights for the model. SeeMobileNet_V2_QuantizedWeightsbelow for more details, and possible values. By default, no pre-trained weights are used.progress (bool, optional) – If True, displays a progress bar of the download to stderr. Default is True.
quantize (bool, optional) – If True, returns a quantized version of the model. Default is False.
**kwargs – parameters passed to the
torchvision.models.quantization.QuantizableMobileNetV2base class. Please refer to the source code for more details about this class.
- class torchvision.models.quantization.MobileNet_V2_QuantizedWeights(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
- class torchvision.models.MobileNet_V2_Weights(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]