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'

解决办法

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

1. 查看curl 路径

~$ which curl
/Users/gclm/anaconda3/bin/curl

2.删除anaconda3 curl 映射

~$ rm -rf /Users/gclm/anaconda3/bin/curl
# 重新查看curl映射
~$ which curl
/usr/bin/curl
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值