from torch_geometric.datasets import Planetoid
dataset = Planetoid(root='./Cora', name='Cora')
在下载一个GNN的数据集时报错,错误信息如下:
Downloading https://github.com/kimiyoung/planetoid/raw/master/data/ind.cora.x
Traceback (most recent call last):
File "C:\Users\lenovo\Anaconda3\lib\urllib\request.py", line 1350, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "C:\Users\lenovo\Anaconda3\lib\http\client.py", line 1240, in request
self._send_request(method, url, body, headers, encode_chunked)
File "C:\Users\lenovo\Anaconda3\lib\http\client.py", line 1286, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "C:\Users\lenovo\Anaconda3\lib\http\client.py", line 1235, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Users\lenovo\Anaconda3\lib\http\client.py", line 1006, in _send_output
self.send(msg)
File "C:\Users\lenovo\Anaconda3\lib\http\client.py", line 946, in send
self.connect()
File "C:\Users\lenovo\Anaconda3\lib\http\client.py", line 1402, in connect
super().connect()
File "C:\Users\lenovo\Anaconda3\lib\http\client.py", line 917, in connect
self.sock = self._create_connection(
File "C:\Users\lenovo\Anaconda3\lib\socket.py", line 787, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "C:\Users\lenovo\Anaconda3\lib\socket.py", line 918, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
gaierror: [Errno 11004] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\Notes\codes\The_Role_of_A\GCN_Cora.py", line 12, in <module>
dataset = Planetoid(root='./Cora', name='Cora')
File "C:\Users\lenovo\Anaconda3\lib\site-packages\torch_geometric\datasets\planetoid.py", line 55, in __init__
super().__init__(root, transform, pre_transform)
File "C:\Users\lenovo\Anaconda3\lib\site-packages\torch_geometric\data\in_memory_dataset.py", line 53, in __init__
super(InMemoryDataset, self).__init__(root, transform, pre_transform,
File "C:\Users\lenovo\Anaconda3\lib\site-packages\torch_geometric\data\dataset.py", line 89, in __init__
self._download()
File "C:\Users\lenovo\Anaconda3\lib\site-packages\torch_geometric\data\dataset.py", line 141, in _download
self.download()
File "C:\Users\lenovo\Anaconda3\lib\site-packages\torch_geometric\datasets\planetoid.py", line 105, in download
download_url('{}/{}'.format(self.url, name), self.raw_dir)
File "C:\Users\lenovo\Anaconda3\lib\site-packages\torch_geometric\data\download.py", line 31, in download_url
data = urllib.request.urlopen(url)
File "C:\Users\lenovo\Anaconda3\lib\urllib\request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "C:\Users\lenovo\Anaconda3\lib\urllib\request.py", line 531, in open
response = meth(req, response)
File "C:\Users\lenovo\Anaconda3\lib\urllib\request.py", line 640, in http_response
response = self.parent.error(
File "C:\Users\lenovo\Anaconda3\lib\urllib\request.py", line 563, in error
result = self._call_chain(*args)
File "C:\Users\lenovo\Anaconda3\lib\urllib\request.py", line 502, in _call_chain
result = func(*args)
File "C:\Users\lenovo\Anaconda3\lib\urllib\request.py", line 755, in http_error_302
return self.parent.open(new, timeout=req.timeout)
File "C:\Users\lenovo\Anaconda3\lib\urllib\request.py", line 525, in open
response = self._open(req, data)
File "C:\Users\lenovo\Anaconda3\lib\urllib\request.py", line 542, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "C:\Users\lenovo\Anaconda3\lib\urllib\request.py", line 502, in _call_chain
result = func(*args)
File "C:\Users\lenovo\Anaconda3\lib\urllib\request.py", line 1393, in https_open
return self.do_open(http.client.HTTPSConnection, req,
File "C:\Users\lenovo\Anaconda3\lib\urllib\request.py", line 1353, in do_open
raise URLError(err)
URLError: <urlopen error [Errno 11004] getaddrinfo failed>