当前位置:   article > 正文

curl: (77) error setting certificate verify locations 解决

curl: (77) error setting certificate verify locations:

错误描述

Downloading https://github.com/ultralytics/yolov5/releases/download/v5.0/yolov5s.pt to weights/yolov5s.pt...
ERROR: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1125)>
Re-attempting https://github.com/ultralytics/yolov5/releases/download/v5.0/yolov5s.pt to weights/yolov5s.pt...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (77) error setting certificate verify locations:
  CAfile: /Users/gclm/anaconda3
  CApath: none
ERROR: Downloaded file 'weights/yolov5s.pt' does not exist or size is < min_bytes=100000.0
weights/yolov5s.pt missing, try downloading from https://github.com/ultralytics/yolov5/releases/

Traceback (most recent call last):
  File "detect.py", line 240, in <module>
    main(opt)
  File "detect.py", line 235, in main
    run(**vars(opt))
  File "/Users/gclm/anaconda3/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 28, in decorate_context
    return func(*args, **kwargs)
  File "detect.py", line 73, in run
    model = attempt_load(weights, map_location=device)  # load FP32 model
  File "/Users/gclm/Projects/07-inskylab/yolov5/models/experimental.py", line 119, in attempt_load
    ckpt = torch.load(attempt_download(w), map_location=map_location)  # load
  File "/Users/gclm/anaconda3/lib/python3.8/site-packages/torch/serialization.py", line 594, in load
    with _open_file_like(f, 'rb') as opened_file:
  File "/Users/gclm/anaconda3/lib/python3.8/site-packages/torch/serialization.py", line 230, in _open_file_like
    return _open_file(name_or_buffer, mode)
  File "/Users/gclm/anaconda3/lib/python3.8/site-packages/torch/serialization.py", line 211, in __init__
    super(_open_file, self).__init__(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: 'weights/yolov5s.pt'
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29

解决办法

根据错误提示,初步推断是anaconda3的问题,优先排查curl 路径是否有问题。

1. 查看curl 路径

~$ which curl
/Users/gclm/anaconda3/bin/curl
  • 1
  • 2

2.删除anaconda3 curl 映射

~$ rm -rf /Users/gclm/anaconda3/bin/curl
# 重新查看curl映射
~$ which curl
/usr/bin/curl
  • 1
  • 2
  • 3
  • 4
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/羊村懒王/article/detail/250210
推荐阅读
相关标签
  

闽ICP备14008679号