models
function defined in module
FastAI.Registries
models()
A
FeatureRegistry for models. Allows you to find and load models for various learning tasks using a unified interface. Call
models() to see a table view of available models:
using
FastAI
models
(
)Which models are available depends on the loaded packages. For example, FastVision.jl adds vision models from Metalhead to the registry. Index the registry with a model ID to get more information about that model:
using
FastAI
:
models
using
FastVision
# loading the package extends the list of available models
models
(
)
[
"
metalhead/resnet18
"
]
If you've selected a model, call
load to then instantiate a model:
model
=
load
(
"
metalhead/resnet18
"
)
By default,
load loads a default version of the model without any pretrained weights.
load(model) also accepts keyword arguments that allow you to specify variants of the model and weight checkpoints that should be loaded.
Loading a checkpoint of pretrained weights:
load(entry; pretrained = true): Use any pretrained weights, if they are available.
load(entry; checkpoint = "checkpoint-name"): Use the weights with given name. See
entry.checkpoints for available checkpoints (if any).
load(entry; pretrained = false): Don't use pretrained weights
Loading a model variant for a specific task:
load(entry; input = ImageTensor, output = OneHotLabel): Load a model variant matching an input and output block.
load(entry; variant = "backbone"): Load a model variant by name. See entry.variants` for available variants.
There is
1
method for FastAI.Registries.models:
The following pages link back here: