[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed
Docker 容器报错Traceback (most recent call last):File "main.py", line 200, in <module>File "attribute_extract/extract_attribute.py", line 37, in __init__File "attribute_extract/models.py", line 25,
·
1. 问题现象
Ubuntu
机器或者 Docker
容器报错
Traceback (most recent call last):
File "main.py", line 200, in <module>
File "attribute_extract/extract_attribute.py", line 37, in __init__
File "attribute_extract/models.py", line 25, in __init__
File "torchvision/models/resnet.py", line 199, in resnet50
File "torch/hub.py", line 433, in load_state_dict_from_url
File "torch/hub.py", line 349, in _download_url_to_file
File "urllib/request.py", line 162, in urlopen
File "urllib/request.py", line 465, in open
File "urllib/request.py", line 483, in _open
File "urllib/request.py", line 443, in _call_chain
File "urllib/request.py", line 1286, in https_open
File "urllib/request.py", line 1245, in do_open
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)>
2. 解决方案
sudo apt-get update
sudo apt-get install ca-certificates
sudo update-ca-certificates --fresh
export SSL_CERT_DIR=/etc/ssl/certs
开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!
更多推荐
已为社区贡献42条内容
所有评论(0)