From ecca1149ea8608c23821eda62c0696bb10823981 Mon Sep 17 00:00:00 2001 From: shyam gupta <60971003+shyamgupta196@users.noreply.github.com> Date: Fri, 22 Dec 2023 06:25:20 +0530 Subject: [PATCH] call as function otherwise generates an error - "AttributeError: 'function' object has no attribute 'named_parameters'" hence call model as a function --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 78f320c..3716b58 100644 --- a/README.md +++ b/README.md @@ -583,7 +583,7 @@ from fastai.vision.models.unet import DynamicUnet ```python def build_res_unet(n_input=1, n_output=2, size=256): device = torch.device("cuda" if torch.cuda.is_available() else "cpu") - body = create_body(resnet18, pretrained=True, n_in=n_input, cut=-2) + body = create_body(resnet18(), pretrained=True, n_in=n_input, cut=-2) net_G = DynamicUnet(body, n_output, (size, size)).to(device) return net_G ```