I am getting this error after loading the model and when the model is called. Below is my code:
def main(hparams):
    device = 'cuda' if torch.cuda.is_available() else 'cpu'
    net = Unet.load_from_checkpoint(hparams.checkpoint)
    net.freeze()
    net.to(device)

    for fn in tqdm(os.listdir(hparams.img_dir)):
        fp = os.path.join(hparams.img_dir, fn)

        img = Image.open(fp)
        mask = predict(net, img, device=device)

        mask_img = mask_to_image(mask)
        mask_img.save(os.path.join(hparams.out_dir, fn))


if __name__ == '__main__':
    parent_parser = ArgumentParser(add_help=False)
    parent_parser.add_argument('--checkpoint', required=True)
    parent_parser.add_argument('--img_dir', required=True)
    parent_parser.add_argument('--out_dir', required=True)

    parser = Unet.add_model_specific_args(parent_parser)
    hparams = parser.parse_args()

    main(hparams)

getting the error at the last line “main(hparams)”. Can someone help me with this, please