def load_state_dict_from_url(url, map_location=None):
    """Try to load the checkopint from the given url."""
    try:
        state_dict = torch.hub.load_state_dict_from_url(url, map_location=map_location)
        return state_dict
    except Exception:
        print("Not able to load state dict from %s" % (url))
        print("Retrying with http:// prefix")
    try:
        url = url.replace("https", "http")
        state_dict = torch.hub.load_state_dict_from_url(url, map_location=map_location)
        return state_dict
    except Exception:
        print("Not able to load state dict from %s" % (url))

    # in this case downloading the pre-trained model was not possible
    # notify the user and return
    return {"state_dict": None}
Try to load the checkopint from the given url.
lightly/cli/_helpers.py