mobilenet_v1¶
- paddle.vision.models. mobilenet_v1 ( pretrained=False, scale=1.0, **kwargs ) [source]
-
MobileNetV1 from “MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications”.
- Parameters
-
pretrained (bool, optional) – Whether to load pre-trained weights. If True, returns a model pre-trained on ImageNet. Default: False.
scale (float, optional) – Scale of channels in each layer. Default: 1.0.
**kwargs (optional) – Additional keyword arguments. For details, please refer to MobileNetV1.
- Returns
-
Layer. An instance of MobileNetV1 model.
Examples
>>> import paddle >>> from paddle.vision.models import mobilenet_v1 >>> # Build model >>> model = mobilenet_v1() >>> # Build model and load imagenet pretrained weight >>> # model = mobilenet_v1(pretrained=True) >>> # build mobilenet v1 with scale=0.5 >>> model_scale = mobilenet_v1(scale=0.5) >>> x = paddle.rand([1, 3, 224, 224]) >>> out = model(x) >>> print(out.shape) [1, 1000]