Skip to content

Unable to find the pretrained models, code errors out #145

@hekimgil

Description

@hekimgil

Right at the start of the use of the library for the first time,
detector = feat.Detector()
breaks the code with the error message added at the end of this message.

I presume the error might be that the code tries to download the necessary pre-trained models listed in the model_list.json file from the repository, but some of the model files are not available. To give an example model files like Logistic_520.joblib and svm_568.joblib do not seem to be in the repository anymore. Very likely, without any parameters given, the code tries to load the pre-trained "svm" (as the default "au_detector"), and breaks as the svm_568.joblib file could not be found in the repository.

The error message mentioned is as follows:

Traceback (most recent call last):
File ".....\Programs\Python\Python39\lib\code.py", line 90, in runcode
exec(code, self.locals)
File "", line 1, in
File ".....\env\lib\site-packages\feat\detector.py", line 108, in init
face, landmark, au, emotion, facepose = get_pretrained_models(
File ".....\env\lib\site-packages\feat\pretrained.py", line 239, in get_pretrained_models
download_url(url, get_resource_path(), verbose=verbose)
File ".....\env\lib\site-packages\feat\utils.py", line 1066, in download_url
return tv_download_url(*args, **kwargs)
File ".....\env\lib\site-packages\torchvision\datasets\utils.py", line 131, in download_url
url = _get_redirect_url(url, max_hops=max_redirect_hops)
File ".....\env\lib\site-packages\torchvision\datasets\utils.py", line 79, in _get_redirect_url
with urllib.request.urlopen(urllib.request.Request(url, headers=headers)) as response:
File ".....\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 214, in urlopen
return opener.open(url, data, timeout)
File ".....\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 523, in open
response = meth(req, response)
File ".....\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 632, in http_response
response = self.parent.error(
File ".....\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 555, in error
result = self._call_chain(*args)
File ".....\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 494, in _call_chain
result = func(*args)
File ".....\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 747, in http_error_302
return self.parent.open(new, timeout=req.timeout)
File ".....\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 523, in open
response = meth(req, response)
File ".....\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 632, in http_response
response = self.parent.error(
File ".....\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 561, in error
return self._call_chain(*args)
File ".....\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 494, in _call_chain
result = func(*args)
File ".....\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 641, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions