diff --git a/utils/general.py b/utils/general.py index 4e5c714..01f0a3b 100644 --- a/utils/general.py +++ b/utils/general.py @@ -631,8 +631,8 @@ def download(url, dir='.', unzip=True, delete=True, curl=False, threads=1, retry for i in range(retry + 1): if curl: s = 'sS' if threads > 1 else '' # silent - r = subprocess.run(f'curl -# -{s}L "{url}" -o "{f}" --retry 9 -C -'.split()) - success = r == 0 + proc = subprocess.run(f'curl -# -{s}L "{url}" -o "{f}" --retry 9 -C -'.split()) + success = proc.returncode == 0 else: torch.hub.download_url_to_file(url, f, progress=threads == 1) # torch download success = f.is_file()