GoogLeNet

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

GoogLeNet(Inception v1)模型,来自论文 "Going Deeper with Convolutions"

参数

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

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

返回

Layer,GoogLeNet(Inception v1)模型实例。

代码示例

>>> import paddle
>>> from paddle.vision.models import GoogLeNet

>>> # Build model
>>> model = GoogLeNet()

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

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