Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

urllib.error.URLError: <urlopen error [Errno 60] Operation timed out> #19

Open
caizhuoyue77 opened this issue Mar 13, 2024 · 1 comment

Comments

@caizhuoyue77
Copy link

First off, this project is amazing.

But when I try to run this. I got this problem.

This is the console output:

tog) ➜ ToG git:(main) ✗ python main_freebase.py --dataset cwq --max_length 256 --temperature_exploration 0.4 --temperature_reasoning 0 --width 3 --depth 3 --remove_unnecessary_rel True --LLM_type gpt-3.5-turbo --opeani_api_keys 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 --num_retain_entity 5 --prune_tools llm Start Running ToG on cwq dataset. 0%| | 0/3531 [00:00<?, ?it/s]

After a while, it says:
`(tog) ➜ ToG git:(main) ✗ python main_freebase.py --dataset cwq --max_length 256 --temperature_exploration 0.4 --temperature_reasoning 0 --width 3 --depth 3 --remove_unnecessary_rel True --LLM_type gpt-3.5-turbo --opeani_api_keys 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 --num_retain_entity 5 --prune_tools llm
Start Running ToG on cwq dataset.
0%| | 0/3531 [01:15<?, ?it/s]
Traceback (most recent call last):
File "/Users/czy/miniconda3/envs/tog/lib/python3.9/urllib/request.py", line 1346, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/Users/czy/miniconda3/envs/tog/lib/python3.9/http/client.py", line 1285, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Users/czy/miniconda3/envs/tog/lib/python3.9/http/client.py", line 1331, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Users/czy/miniconda3/envs/tog/lib/python3.9/http/client.py", line 1280, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Users/czy/miniconda3/envs/tog/lib/python3.9/http/client.py", line 1040, in _send_output
self.send(msg)
File "/Users/czy/miniconda3/envs/tog/lib/python3.9/http/client.py", line 980, in send
self.connect()
File "/Users/czy/miniconda3/envs/tog/lib/python3.9/http/client.py", line 946, in connect
self.sock = self._create_connection(
File "/Users/czy/miniconda3/envs/tog/lib/python3.9/socket.py", line 844, in create_connection
raise err
File "/Users/czy/miniconda3/envs/tog/lib/python3.9/socket.py", line 832, in create_connection
sock.connect(sa)
TimeoutError: [Errno 60] Operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/czy/Desktop/3月毕设/ToG/ToG/main_freebase.py", line 53, in
retrieve_relations_with_scores = relation_search_prune(entity, topic_entity[entity], pre_relations, pre_heads[i], question, args) # best entity triplet, entitiy_id
File "/Users/czy/Desktop/3月毕设/ToG/ToG/freebase_func.py", line 111, in relation_search_prune
head_relations = execurte_sparql(sparql_relations_extract_head)
File "/Users/czy/Desktop/3月毕设/ToG/ToG/freebase_func.py", line 26, in execurte_sparql
results = sparql.query().convert()
File "/Users/czy/miniconda3/envs/tog/lib/python3.9/site-packages/SPARQLWrapper/Wrapper.py", line 960, in query
return QueryResult(self._query())
File "/Users/czy/miniconda3/envs/tog/lib/python3.9/site-packages/SPARQLWrapper/Wrapper.py", line 926, in _query
response = urlopener(request)
File "/Users/czy/miniconda3/envs/tog/lib/python3.9/urllib/request.py", line 214, in urlopen
return opener.open(url, data, timeout)
File "/Users/czy/miniconda3/envs/tog/lib/python3.9/urllib/request.py", line 517, in open
response = self._open(req, data)
File "/Users/czy/miniconda3/envs/tog/lib/python3.9/urllib/request.py", line 534, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/Users/czy/miniconda3/envs/tog/lib/python3.9/urllib/request.py", line 494, in _call_chain
result = func(*args)
File "/Users/czy/miniconda3/envs/tog/lib/python3.9/urllib/request.py", line 1375, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "/Users/czy/miniconda3/envs/tog/lib/python3.9/urllib/request.py", line 1349, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 60] Operation timed out>
`
Does anyone have the same problem? Or could you tell me what's wrong?

I have vpn installed and I can use openai's APIs using my own code.

@GasolSun36
Copy link
Collaborator

Hi,
The possible reasons are that Freebase was not installed successfully or there is a problem with your network. Please make sure that openai can respond to requests normally before trying to reinstall freebase.
In addition, the link to openai in your question was leaked, please edit it to prevent others from seeing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants