Problem getting SSL cert
Search before asking
- [x] I have searched the Pytorch-Wildlife issues and found no similar bug report.
Bug
I have a user trying to do some analyses with PytorchWildlife for the first time and they are getting the following error:
Traceback (most recent call last): File "/opt/miniconda3/envs/detector/lib/python3.8/urllib/request.py", line 1317, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "/opt/miniconda3/envs/detector/lib/python3.8/http/client.py", line 1230, in request self._send_request(method, url, body, headers, encode_chunked) File "/opt/miniconda3/envs/detector/lib/python3.8/http/client.py", line 1276, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/opt/miniconda3/envs/detector/lib/python3.8/http/client.py", line 1225, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/opt/miniconda3/envs/detector/lib/python3.8/http/client.py", line 1004, in _send_output self.send(msg) File "/opt/miniconda3/envs/detector/lib/python3.8/http/client.py", line 944, in send self.connect() File "/opt/miniconda3/envs/detector/lib/python3.8/http/client.py", line 1399, in connect self.sock = self._context.wrap_socket(self.sock, File "/opt/miniconda3/envs/detector/lib/python3.8/ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "/opt/miniconda3/envs/detector/lib/python3.8/ssl.py", line 1040, in _create self.do_handshake() File "/opt/miniconda3/envs/detector/lib/python3.8/ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)
If I try to run the exact same analyses (same code/commands/etc.) with a user who had previously used PytorchWildlife I don't get that error, it runs fine
Environment
- PytorchWildlife 1.2.0
- ca-certificates 2024.12.31
- ultralytics 8.3.63
- ultralytics-thop 2.0.14
- ultralytics-yolov5 0.1.1
- urllib3 2.2.3
- Ububtu 24.04.2
Minimal Reproducible Example
No response
Additional
No response
Are you willing to submit a PR?
- [ ] Yes I'd like to help by submitting a PR!
I'm wondering if the issue is with zenodo and your detectors. For example, in megadetectorv6.py you have
if version == 'MDV6-yolov9-c':
url = "https://zenodo.org/records/14567879/files/MDV6b-yolov9c.pt?download=1"
self.MODEL_NAME = "MDV6b-yolov9c.pt"
elif version == 'MDV6-yolov9-e':
url = "https://zenodo.org/records/14567879/files/MDV6-yolov9e.pt?download=1"
self.MODEL_NAME = "MDV6-yolov9e.pt"
elif version == 'MDV6-yolov10-c':
url = "https://zenodo.org/records/14567879/files/MDV6-yolov10n.pt?download=1"
self.MODEL_NAME = "MDV6-yolov10n.pt"
elif version == 'MDV6-yolov10-e':
url = "https://zenodo.org/records/14567879/files/MDV6-yolov10x.pt?download=1"
self.MODEL_NAME = "MDV6-yolov10x.pt"
elif version == 'MDV6-rtdetr-c':
url = "https://zenodo.org/records/14567879/files/MDV6b-rtdetrl.pt?download=1"
self.MODEL_NAME = "MDV6b-rtdetrl.pt"
That hash number after the records portion of the URL seems to refer to Version v11 of the models and according to Zenodo, the most recent version is Version V15, which has a different value after the records portion of the URL (V15 is 14775968)
Hi @aweaver1fandm thanks for reaching out, and apologies for the delayed response. We have now released Version 22 of the models on Zenodo, and the URLs in megadetectorv6.py have been updated according to this latest version. Could you please try pulling the latest code and let us know if the SSL certificate verification error persists? The update should resolve any issues related to outdated or invalid download URLs, but if the error remains, we are happy to help further troubleshoot.