ozendelait / rvc_devkit

Robust Vision Challenge Devkits
http://www.robustvision.net/
MIT License
107 stars 13 forks source link

Error when downloading stereo dataset #16

Closed mli0603 closed 4 years ago

mli0603 commented 4 years ago

Here is the output when running stereo_devkit.py

Traceback (most recent call last):
  File "/home/max/anaconda3/envs/pytorch/lib/python3.8/urllib/request.py", line 1319, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/home/max/anaconda3/envs/pytorch/lib/python3.8/http/client.py", line 1230, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/home/max/anaconda3/envs/pytorch/lib/python3.8/http/client.py", line 1276, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/home/max/anaconda3/envs/pytorch/lib/python3.8/http/client.py", line 1225, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/home/max/anaconda3/envs/pytorch/lib/python3.8/http/client.py", line 1004, in _send_output
    self.send(msg)
  File "/home/max/anaconda3/envs/pytorch/lib/python3.8/http/client.py", line 944, in send
    self.connect()
  File "/home/max/anaconda3/envs/pytorch/lib/python3.8/http/client.py", line 1399, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "/home/max/anaconda3/envs/pytorch/lib/python3.8/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/home/max/anaconda3/envs/pytorch/lib/python3.8/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/home/max/anaconda3/envs/pytorch/lib/python3.8/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "stereo_devkit.py", line 23, in <module>
    DevkitMain('Stereo', benchmarks, dataset_formats)
  File "/home/max/git_ws/rvc_devkit/stereo/devkit.py", line 577, in DevkitMain
    DownloadAndConvertDatasets(chosen_format,
  File "/home/max/git_ws/rvc_devkit/stereo/devkit.py", line 128, in DownloadAndConvertDatasets
    benchmark.DownloadAndUnpack(benchmark_archive_dir, unpack_dir_path, metadata_dict)
  File "/home/max/git_ws/rvc_devkit/stereo/benchmark_middlebury2014.py", line 55, in DownloadAndUnpack
    DownloadAndUnzipFile('http://vision.middlebury.edu/stereo/submit3/zip/MiddEval3-data-' + metadata_dict['resolution'] + '.zip', archive_dir_path, unpack_dir_path)
  File "/home/max/git_ws/rvc_devkit/stereo/util.py", line 134, in DownloadAndUnzipFile
    archive_path = DownloadFile(url, archive_dir_path)
  File "/home/max/git_ws/rvc_devkit/stereo/util.py", line 91, in DownloadFile
    url_object = urllib.request.urlopen(url)
  File "/home/max/anaconda3/envs/pytorch/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/home/max/anaconda3/envs/pytorch/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/home/max/anaconda3/envs/pytorch/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/home/max/anaconda3/envs/pytorch/lib/python3.8/urllib/request.py", line 563, in error
    result = self._call_chain(*args)
  File "/home/max/anaconda3/envs/pytorch/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/home/max/anaconda3/envs/pytorch/lib/python3.8/urllib/request.py", line 755, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/home/max/anaconda3/envs/pytorch/lib/python3.8/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/home/max/anaconda3/envs/pytorch/lib/python3.8/urllib/request.py", line 542, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/home/max/anaconda3/envs/pytorch/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/home/max/anaconda3/envs/pytorch/lib/python3.8/urllib/request.py", line 1362, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/home/max/anaconda3/envs/pytorch/lib/python3.8/urllib/request.py", line 1322, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)>
ozendelait commented 4 years ago

Hi, this looks like an SSL error. Are you behind a company proxy?

Some suggestions on stackoverflow are: ) install/update certifi: pip install --upgrade certifi ) use explicit ssl context (needs working certifi): change line 91 of "/home/max/git_ws/rvc_devkit/stereo/util.py" from url_object = urllib.request.urlopen(url) to url_object = urllib.request.urlopen(url, context=ssl.create_default_context(cafile=certifi.where()))

This needs two imports: import ssl import certifi

Does one of the steps work?

ozendelait commented 4 years ago

I updated the dev kit to allow skipping of ssl verification; define: export RVC_CUSTOM_SSL_SKIP_VERIFY=1