code: def unet_learner(
      dls,
      arch,
      normalize=True,
      n_out=None,
      pretrained=True,
      weights=None,
      config=None,
      # learner args
      loss_func=None,
      opt_func=Adam,
      lr=defaults.lr,
      splitter=None,
      cbs=None,
      metrics=None,
      path=None,
      model_dir="models",
      wd=None,
      wd_bn_bias=False,
      train_bn=True,
      moms=(0.95, 0.85, 0.95),
      **kwargs,
  ):
      "Build a unet learner from `dls` and `arch`"
  
      if config:
          warnings.warn(
              "config param is deprecated. Pass your args directly to unet_learner."
          )
          kwargs = {**config, **kwargs}
  
      meta = model_meta.get(arch, _default_meta)
      n_in = kwargs["n_in"] if "n_in" in kwargs else 3
      if normalize:
          _add_norm(dls, meta, pretrained, n_in)
  
      n_out = ifnone(n_out, get_c(dls))
      assert (
          n_out
      ), "`n_out` is not defined, and could not be inferred from data, set `dls.c` or pass `n_out`"
      img_size = dls.one_batch()[0].shape[-2:]
      assert img_size, "image size could not be inferred from data"
      model = create_unet_model(
          arch,
          n_out,
          img_size,
          pretrained=pretrained,
          weights=weights,
          **kwargs,
      )
  
      splitter = ifnone(splitter, meta["split"])
      learn = Learner(
          dls=dls,
          model=model,
          loss_func=loss_func,
          opt_func=opt_func,
          lr=lr,
          splitter=splitter,
          cbs=cbs,
          metrics=metrics,
          path=path,
          model_dir=model_dir,
          wd=wd,
          wd_bn_bias=wd_bn_bias,
          train_bn=train_bn,
          moms=moms,
      )
      if pretrained:
          learn.freeze()
      # keep track of args for loggers
      store_attr(
          "arch,normalize,n_out,pretrained", self=learn, **kwargs
      )
      return learn
  
imports: from __future__ import annotations
  from packaging.version import parse
  from ..basics import *
  from .core import *
  from .data import *
  from .augment import *
  from .None import models
  import torchvision
  from ..callback.hook import num_features_model
label_desc: Use image node_id 23 for calling a global function with example usage: unet_learner(dls, arch, normalize, n_out, pretrained, weights, config, loss_func, opt_func, lr, splitter, cbs, metrics, path, model_dir, wd, wd_bn_bias, train_bn, moms) and returns: learn