mmrotate
mmrotate copied to clipboard
[Bug] urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1131)>
Prerequisite
- [X] I have searched Issues and Discussions but cannot get the expected help.
- [X] I have read the FAQ documentation but cannot get the expected help.
- [X] The bug has not been fixed in the latest version (master) or latest version (1.x).
Task
I'm using the official example scripts/configs for the officially supported tasks/models/datasets.
Branch
master branch https://github.com/open-mmlab/mmrotate
Environment
addict 2.4.0 certifi 2023.5.7 charset-normalizer 3.1.0 click 8.1.3 colorama 0.4.6 contourpy 1.1.0 cycler 0.11.0 e2cnn 0.2.3 fonttools 4.40.0 idna 3.4 importlib-metadata 6.7.0 importlib-resources 5.12.0 kiwisolver 1.4.4 Markdown 3.4.3 markdown-it-py 3.0.0 matplotlib 3.7.1 mdurl 0.1.2 mkl-fft 1.3.6 mkl-random 1.2.2 mkl-service 2.4.0 mmcv-full 1.7.1 mmdet 2.28.2 mmrotate 0.3.4 /home/hqt/MyProgram/mmrotate model-index 0.1.11 mpmath 1.3.0 numpy 1.24.3 opencv-python 4.8.0.74 opendatalab 0.0.9 openmim 0.3.9 ordered-set 4.1.0 packaging 23.1 pandas 2.0.3 Pillow 9.3.0 pip 23.1.2 platformdirs 3.8.0 pycocotools 2.0.6 pycryptodome 3.18.0 Pygments 2.15.1 pyparsing 3.1.0 python-dateutil 2.8.2 pytz 2023.3 PyYAML 6.0 requests 2.31.0 rich 13.4.2 scipy 1.10.1 setuptools 67.8.0 six 1.16.0 sympy 1.12 tabulate 0.9.0 terminaltables 3.1.10 tomli 2.0.1 torch 1.8.0 torchvision 0.9.0 tqdm 4.65.0 typing_extensions 4.6.3 tzdata 2023.3 urllib3 2.0.3 wheel 0.38.4 yapf 0.40.1 zipp 3.15.0
Reproduces the problem - code sample
try:
try:
# import ssl
# ssl._create_default_https_context = ssl._create_unverified_context
h.request(req.get_method(), req.selector, req.data, headers,
encode_chunked=req.has_header('Transfer-encoding'))
except OSError as err: # timeout error
raise URLError(err)
r = h.getresponse()
except:
h.close()
raise
The third and fourth lines of code were added by myself, but I still reported an error after adding it, and line 8 is where the error was reported
Reproduces the problem - command or script
python tools/train.py /home/hqt/MyProgram/mmrotate_faster_rcnn/mmrotate/configs/rotated_faster_rcnn/rotated_faster_rcnn_r50_fpn_1x_dota_le90.py --work-dir /home/hqt/MyProgram/mmrotate_faster_rcnn/mmrotate/save
Reproduces the problem - error message
Traceback (most recent call last): File "/home/hqt/anaconda3/envs/mmrotate/lib/python3.8/urllib/request.py", line 1356, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "/home/hqt/anaconda3/envs/mmrotate/lib/python3.8/http/client.py", line 1256, in request self._send_request(method, url, body, headers, encode_chunked) File "/home/hqt/anaconda3/envs/mmrotate/lib/python3.8/http/client.py", line 1302, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/home/hqt/anaconda3/envs/mmrotate/lib/python3.8/http/client.py", line 1251, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/home/hqt/anaconda3/envs/mmrotate/lib/python3.8/http/client.py", line 1011, in _send_output self.send(msg) File "/home/hqt/anaconda3/envs/mmrotate/lib/python3.8/http/client.py", line 951, in send self.connect() File "/home/hqt/anaconda3/envs/mmrotate/lib/python3.8/http/client.py", line 1425, in connect self.sock = self._context.wrap_socket(self.sock, File "/home/hqt/anaconda3/envs/mmrotate/lib/python3.8/ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "/home/hqt/anaconda3/envs/mmrotate/lib/python3.8/ssl.py", line 1040, in _create self.do_handshake() File "/home/hqt/anaconda3/envs/mmrotate/lib/python3.8/ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1131)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "tools/train.py", line 194, in
Additional information
No response
I have solved it