resnet18

paddle.vision.models. resnet18 ( pretrained=False, **kwargs ) [source]

ResNet 18-layer model from “Deep Residual Learning for Image Recognition”

Parameters

pretrained (bool, optional) – If True, returns a model pre-trained on ImageNet. Default: False.

Examples

import paddle
from paddle.vision.models import resnet18

# build model
model = resnet18()

# build model and load imagenet pretrained weight
# model = resnet18(pretrained=True)

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

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