-
-
Notifications
You must be signed in to change notification settings - Fork 16.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Github release assets model autodownload #711
Conversation
Ok I think this looks good now, but unfortunately I'm seeing an error locally that doesn't show up in the checks. I get this on a Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1350, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1255, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1301, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1250, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1010, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 950, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1424, in connect
self.sock = self._context.wrap_socket(self.sock,
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1040, in _create
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.8/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:1123)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/glennjocher/PycharmProjects/yolov5/detect.py", line 171, in <module>
detect()
File "/Users/glennjocher/PycharmProjects/yolov5/detect.py", line 33, in detect
model = attempt_load(weights, map_location=device) # load FP32 model
File "/Users/glennjocher/PycharmProjects/yolov5/models/experimental.py", line 136, in attempt_load
attempt_download(w)
File "/Users/glennjocher/PycharmProjects/yolov5/utils/google_utils.py", line 31, in attempt_download
hub.download_url_to_file('https://github.com/ultralytics/yolov5/releases/download/v2.0/' + file, weights)
File "/Users/glennjocher/PycharmProjects/yolov5/venv/lib/python3.8/site-packages/torch/hub.py", line 379, in download_url_to_file
u = urlopen(req)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 542, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1393, in https_open
return self.do_open(http.client.HTTPSConnection, req,
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1353, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)> It looks like the problem is specific to MacOS with python requests (I'm running on a Macbook). We may have to ditch the torch downloader for the existing curl commands, which I've never seen anyone report problems with. |
I dropped all this into a try, except, finally clause. Try GitHub, except GCP, finally check and return |
CI is passing, everything seems good, merging. |
* assets autodownload * Update google_utils.py * Update google_utils.py * Update google_utils.py * Update google_utils.py * Update google_utils.py Co-authored-by: Glenn Jocher <[email protected]>
* assets autodownload * Update google_utils.py * Update google_utils.py * Update google_utils.py * Update google_utils.py * Update google_utils.py Co-authored-by: Glenn Jocher <[email protected]>
* assets autodownload * Update google_utils.py * Update google_utils.py * Update google_utils.py * Update google_utils.py * Update google_utils.py Co-authored-by: Glenn Jocher <[email protected]>
π οΈ PR Summary
Made with β€οΈ by Ultralytics Actions
π Summary
Simplified and robust pretrained model downloading in Ultralytics YOLOv5.
π Key Changes
π― Purpose & Impact