Skip to content

voc segmentation dataset source is unavailable #9271

@yeeislazy

Description

@yeeislazy

🐛 Describe the bug

Both downloads VOC Segmentation dataset using torchvision.dataset.vocsegmentation and http://host.robots.ox.ac.uk/pascal/VOC/, are unavailable (currently 14/11/2025)

import torchvision

trainset = torchvision.datasets.VOCSegmentation(root='../../data', year='2012', image_set='train', download=True)
---------------------------------------------------------------------------
TimeoutError                              Traceback (most recent call last)
File d:\Develop\miniconda\envs\torch\lib\urllib\request.py:1348, in AbstractHTTPHandler.do_open(self, http_class, req, **http_conn_args)
   1347 try:
-> 1348     h.request(req.get_method(), req.selector, req.data, headers,
   1349               encode_chunked=req.has_header('Transfer-encoding'))
   1350 except OSError as err: # timeout error

File d:\Develop\miniconda\envs\torch\lib\http\client.py:1283, in HTTPConnection.request(self, method, url, body, headers, encode_chunked)
   1282 """Send a complete request to the server."""
-> 1283 self._send_request(method, url, body, headers, encode_chunked)

File d:\Develop\miniconda\envs\torch\lib\http\client.py:1329, in HTTPConnection._send_request(self, method, url, body, headers, encode_chunked)
   1328     body = _encode(body, 'body')
-> 1329 self.endheaders(body, encode_chunked=encode_chunked)

File d:\Develop\miniconda\envs\torch\lib\http\client.py:1278, in HTTPConnection.endheaders(self, message_body, encode_chunked)
   1277     raise CannotSendHeader()
-> 1278 self._send_output(message_body, encode_chunked=encode_chunked)

File d:\Develop\miniconda\envs\torch\lib\http\client.py:1038, in HTTPConnection._send_output(self, message_body, encode_chunked)
   1037 del self._buffer[:]
-> 1038 self.send(msg)
   1040 if message_body is not None:
   1041 
   1042     # create a consistent interface to message_body

File d:\Develop\miniconda\envs\torch\lib\http\client.py:976, in HTTPConnection.send(self, data)
    975 if self.auto_open:
--> 976     self.connect()
    977 else:

File d:\Develop\miniconda\envs\torch\lib\http\client.py:942, in HTTPConnection.connect(self)
    941 sys.audit("http.client.connect", self, self.host, self.port)
--> 942 self.sock = self._create_connection(
    943     (self.host,self.port), self.timeout, self.source_address)
    944 # Might fail in OSs that don't implement TCP_NODELAY

File d:\Develop\miniconda\envs\torch\lib\socket.py:857, in create_connection(address, timeout, source_address)
    856 try:
--> 857     raise err
    858 finally:
    859     # Break explicitly a reference cycle

File d:\Develop\miniconda\envs\torch\lib\socket.py:845, in create_connection(address, timeout, source_address)
    844     sock.bind(source_address)
--> 845 sock.connect(sa)
    846 # Break explicitly a reference cycle

TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

During handling of the above exception, another exception occurred:

URLError                                  Traceback (most recent call last)
Cell In[4], line 4
      1 import torch
      2 import torchvision
----> 4 trainset = torchvision.datasets.VOCSegmentation(root='../../data', year='2011', image_set='train', download=True)

File d:\Develop\miniconda\envs\torch\lib\site-packages\torchvision\datasets\voc.py:98, in _VOCBase.__init__(self, root, year, image_set, download, transform, target_transform, transforms)
     95 voc_root = os.path.join(self.root, base_dir)
     97 if download:
---> 98     download_and_extract_archive(self.url, self.root, filename=self.filename, md5=self.md5)
    100 if not os.path.isdir(voc_root):
    101     raise RuntimeError("Dataset not found or corrupted. You can use download=True to download it")

File d:\Develop\miniconda\envs\torch\lib\site-packages\torchvision\datasets\utils.py:395, in download_and_extract_archive(url, download_root, extract_root, filename, md5, remove_finished)
    392 if not filename:
    393     filename = os.path.basename(url)
--> 395 download_url(url, download_root, filename, md5)
    397 archive = os.path.join(download_root, filename)
    398 print(f"Extracting {archive} to {extract_root}")

File d:\Develop\miniconda\envs\torch\lib\site-packages\torchvision\datasets\utils.py:122, in download_url(url, root, filename, md5, max_redirect_hops)
    119     _download_file_from_remote_location(fpath, url)
    120 else:
    121     # expand redirect chain if needed
--> 122     url = _get_redirect_url(url, max_hops=max_redirect_hops)
    124     # check if file is located on Google Drive
    125     file_id = _get_google_drive_file_id(url)

File d:\Develop\miniconda\envs\torch\lib\site-packages\torchvision\datasets\utils.py:66, in _get_redirect_url(url, max_hops)
     63 headers = {"Method": "HEAD", "User-Agent": USER_AGENT}
     65 for _ in range(max_hops + 1):
---> 66     with urllib.request.urlopen(urllib.request.Request(url, headers=headers)) as response:
     67         if response.url == url or response.url is None:
     68             return url

File d:\Develop\miniconda\envs\torch\lib\urllib\request.py:216, in urlopen(url, data, timeout, cafile, capath, cadefault, context)
    214 else:
    215     opener = _opener
--> 216 return opener.open(url, data, timeout)

File d:\Develop\miniconda\envs\torch\lib\urllib\request.py:519, in OpenerDirector.open(self, fullurl, data, timeout)
    516     req = meth(req)
    518 sys.audit('urllib.Request', req.full_url, req.data, req.headers, req.get_method())
--> 519 response = self._open(req, data)
    521 # post-process response
    522 meth_name = protocol+"_response"

File d:\Develop\miniconda\envs\torch\lib\urllib\request.py:536, in OpenerDirector._open(self, req, data)
    533     return result
    535 protocol = req.type
--> 536 result = self._call_chain(self.handle_open, protocol, protocol +
    537                           '_open', req)
    538 if result:
    539     return result

File d:\Develop\miniconda\envs\torch\lib\urllib\request.py:496, in OpenerDirector._call_chain(self, chain, kind, meth_name, *args)
    494 for handler in handlers:
    495     func = getattr(handler, meth_name)
--> 496     result = func(*args)
    497     if result is not None:
    498         return result

File d:\Develop\miniconda\envs\torch\lib\urllib\request.py:1377, in HTTPHandler.http_open(self, req)
   1376 def http_open(self, req):
-> 1377     return self.do_open(http.client.HTTPConnection, req)

File d:\Develop\miniconda\envs\torch\lib\urllib\request.py:1351, in AbstractHTTPHandler.do_open(self, http_class, req, **http_conn_args)
   1348         h.request(req.get_method(), req.selector, req.data, headers,
   1349                   encode_chunked=req.has_header('Transfer-encoding'))
   1350     except OSError as err: # timeout error
-> 1351         raise URLError(err)
   1352     r = h.getresponse()
   1353 except:

URLError: <urlopen error [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond>

Versions

Collecting environment information...
PyTorch version: 2.5.1
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: Microsoft Windows 11 Pro (10.0.26200 64-bit)
GCC version: Could not collect
Clang version: Could not collect
CMake version: Could not collect
Libc version: N/A

Python version: 3.10.18 | packaged by Anaconda, Inc. | (main, Jun 5 2025, 13:08:55) [MSC v.1929 64 bit (AMD64)] (64-bit runtime)
Python platform: Windows-10-10.0.26200-SP0
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
Is XPU available: False
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Name: AMD Ryzen 7 9700X 8-Core Processor
Manufacturer: AuthenticAMD
Family: 107
Architecture: 9
ProcessorType: 3
DeviceID: CPU0
CurrentClockSpeed: 3800
MaxClockSpeed: 3800
L2CacheSize: 8192
L2CacheSpeed: None
Revision: 17408

Versions of relevant libraries:
[pip3] mkl_fft==1.3.11
[pip3] mkl_random==1.2.8
[pip3] mkl-service==2.4.0
[pip3] numpy==1.23.5
[pip3] torch==2.5.1
[pip3] torchaudio==2.5.1
[pip3] torchvision==0.20.1
[conda] blas 1.0 mkl
[conda] cpuonly 2.0 0 pytorch
[conda] intel-openmp 2023.1.0 h59b6b97_46320
[conda] mkl 2023.1.0 h6b88ed4_46358
[conda] mkl-service 2.4.0 py310h827c3e9_2
[conda] mkl_fft 1.3.11 py310h827c3e9_0
[conda] mkl_random 1.2.8 py310hc64d2fc_0
[conda] numpy 1.23.5 pypi_0 pypi
[conda] pytorch 2.5.1 py3.10_cpu_0 pytorch
[conda] pytorch-mutex 1.0 cpu pytorch
[conda] tbb 2021.8.0 h59b6b97_0
[conda] torchaudio 2.5.1 py310_cpu pytorch
[conda] torchvision 0.20.1 py310_cpu pytorch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions