MouseLand/facemap

Trouble with certificates in model loader with keypoints facemap

ratliffj opened this issue · 4 comments

Hi Carsen and crew,

I was trying to install the keypoint tracking version of facemap after having used the other version for a while. After getting the install sorted out, I ran into an issue when first running facemap. It seemed to be having trouble downloading the models needed (see below). I solved this by manually downloading the model from "https://www.facemappy.org/models/facemap_model_state.pt" and putting it in the "....facemap\models" directory.

`(facemap-key) C:\Users\renatalab>python -m facemap
numpy version: 1.23.5
python version: 3.8.16
QGridLayoutEngine::addItem: Cell (2, 0) already taken
QGridLayoutEngine::addItem: Cell (3, 0) already taken
Downloading https://www.facemappy.org/models/facemap_model_state.pt to C:\Users\renatalab.facemap\models\facemap_model_state.pt
Traceback (most recent call last):
File "C:\Users\renatalab.conda\envs\facemap-key\lib\urllib\request.py", line 1354, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "C:\Users\renatalab.conda\envs\facemap-key\lib\http\client.py", line 1256, in request
self._send_request(method, url, body, headers, encode_chunked)
File "C:\Users\renatalab.conda\envs\facemap-key\lib\http\client.py", line 1302, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "C:\Users\renatalab.conda\envs\facemap-key\lib\http\client.py", line 1251, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Users\renatalab.conda\envs\facemap-key\lib\http\client.py", line 1011, in _send_output
self.send(msg)
File "C:\Users\renatalab.conda\envs\facemap-key\lib\http\client.py", line 951, in send
self.connect()
File "C:\Users\renatalab.conda\envs\facemap-key\lib\http\client.py", line 1425, in connect
self.sock = self._context.wrap_socket(self.sock,
File "C:\Users\renatalab.conda\envs\facemap-key\lib\ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "C:\Users\renatalab.conda\envs\facemap-key\lib\ssl.py", line 1040, in _create
self.do_handshake()
File "C:\Users\renatalab.conda\envs\facemap-key\lib\ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1131)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\renatalab.conda\envs\facemap-key\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\renatalab.conda\envs\facemap-key\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\renatalab.conda\envs\facemap-key\lib\site-packages\facemap_main
.py", line 95, in
gui.run(
File "C:\Users\renatalab.conda\envs\facemap-key\lib\site-packages\facemap\gui\gui.py", line 3280, in run
GUI = MainW(
File "C:\Users\renatalab.conda\envs\facemap-key\lib\site-packages\facemap\gui\gui.py", line 359, in init
self.make_buttons()
File "C:\Users\renatalab.conda\envs\facemap-key\lib\site-packages\facemap\gui\gui.py", line 492, in make_buttons
self.update_pose_model_combo_box()
File "C:\Users\renatalab.conda\envs\facemap-key\lib\site-packages\facemap\gui\gui.py", line 804, in update_pose_model_combo_box
models.append(model_loader.get_basemodel_state_path())
File "C:\Users\renatalab.conda\envs\facemap-key\lib\site-packages\facemap\pose\model_loader.py", line 87, in get_basemodel_state_path
download_url_to_file(MODEL_STATE_URL, cached_state_file)
File "C:\Users\renatalab.conda\envs\facemap-key\lib\site-packages\facemap\pose\model_loader.py", line 104, in download_url_to_file
urlretrieve(url, filename)
File "C:\Users\renatalab.conda\envs\facemap-key\lib\urllib\request.py", line 247, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "C:\Users\renatalab.conda\envs\facemap-key\lib\urllib\request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "C:\Users\renatalab.conda\envs\facemap-key\lib\urllib\request.py", line 525, in open
response = self._open(req, data)
File "C:\Users\renatalab.conda\envs\facemap-key\lib\urllib\request.py", line 542, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "C:\Users\renatalab.conda\envs\facemap-key\lib\urllib\request.py", line 502, in _call_chain
result = func(*args)
File "C:\Users\renatalab.conda\envs\facemap-key\lib\urllib\request.py", line 1397, in https_open
return self.do_open(http.client.HTTPSConnection, req,
File "C:\Users\renatalab.conda\envs\facemap-key\lib\urllib\request.py", line 1357, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1131)>`

Hi, I am facing a similar issue. Were you able to resolve this? :)

It's been a little while but I recall being able to go to the download url (https://www.facemappy.org/models/facemap_model_state.pt), the download automatically starting and then manually placing this file in the correct directory from this line: "Downloading https://www.facemappy.org/models/facemap_model_state.pt to C:\Users\renatalab.facemap\models\facemap_model_state.pt". I think there might have been a few files that I had to do this with before it worked.

Hi ratliffj!

For some reason it still tried to download it? Did I not download it correctly?

Manually putting file into directory