def load_model(cache_dir: Union[(Path, str)]) -> nn.Module:
    model_file = download_url('http://places2.csail.mit.edu/models_places365/wideresnet18_places365.pth.tar', cache_dir)
    model = wideresnet.resnet18(num_classes=365)
    checkpoint = torch.load(model_file, map_location=(lambda storage, loc: storage))
    state_dict = {str.replace(k, 'module.', ''): v for (k, v) in checkpoint['state_dict'].items()}
    model.load_state_dict(state_dict)
    for (i, (name, module)) in enumerate(model._modules.items()):
        module = recursion_change_bn(model)
    model.avgpool = torch.nn.AvgPool2d(kernel_size=14, stride=1, padding=0)
    model.eval()
    return model
def load_model(cache_dir: Union[(Path, str)]) -> nn.Module:
    model_file = download_url('http://places2.csail.mit.edu/models_places365/wideresnet18_places365.pth.tar', cache_dir)
    model = wideresnet.resnet18(num_classes=365)
    checkpoint = torch.load(model_file, map_location=(lambda storage, loc: storage))
    state_dict = {str.replace(k, 'module.', ): v for (k, v) in checkpoint['state_dict'].items()}
    model.load_state_dict(state_dict)
    for (i, (name, module)) in enumerate(model._modules.items()):
        module = recursion_change_bn(model)
    model.avgpool = torch.nn.AvgPool2d(kernel_size=14, stride=1, padding=0)
    model.eval()
    return model