SqueezeNet

paddle.vision.models. SqueezeNet ( version, num_classes=1000, with_pool=True ) [源代码]

SqueezeNet 模型,来自论文 "SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and <0.5MB model size"

参数

  • version (str) - SqueezeNet 的版本,有 "1.0" 和 "1.1" 可选。默认值为 "1.1"。

  • num_classes (int,可选) - 最后一个全连接层输出的维度。如果该值小于等于 0,则不定义最后一个全连接层。默认值为 1000。

  • with_pool (bool,可选) - 是否定义最后一个全连接层之前的池化层。默认值为 True。

返回

Layer,SqueezeNet 模型实例。

代码示例

>>> import paddle
>>> from paddle.vision.models import SqueezeNet

>>> # build v1.0 model
>>> model = SqueezeNet(version='1.0')

>>> # build v1.1 model
>>> # model = SqueezeNet(version='1.1')

>>> x = paddle.rand([1, 3, 224, 224])
>>> out = model(x)

>>> print(out.shape)
[1, 1000]