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

ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。 #4

Open
cscss opened this issue Dec 3, 2020 · 11 comments

Comments

@cscss
Copy link

cscss commented Dec 3, 2020

Dear Author:
Hi! I try to download the dataset using PyDrive. But this problem comes to me. I don't know how to deal with it. And I try to download again after 24 hours. But the problem still occurs. Could you help me? Thanks a lot.
ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。

@royorel
Copy link
Owner

royorel commented Dec 3, 2020

Hello @cscss

I will need more details in order to help you. Can you attach the full traceback of the error? (the python output that traces the error back to its source) I need to see what part of the code triggered it. In addition, please specify what flags did you use when you ran the program, your machine OS and whether or not you ran it on a remote (headless) server.

@cscss
Copy link
Author

cscss commented Dec 3, 2020

Thanks for your reply. I run download_ffhq_aging.py in my winodws and set args.resolution=256, args.pydrive=True, args.cmd_auth=True
The full error is as follows:
Go to the following link in your browser:

https://accounts.google.com/o/oauth2/auth?client_id=134667004926-vo5t13kj8pdjm32lqg3b9r2mcc8p7naa.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&access_type=offline&response_type=code

Enter verification code: 4/1AY0e-g7BVyUGA3TsxyXGf6anW2L9RYWJ_hi-2RF0orleNNbl2h7rqLG6Gm0
Traceback (most recent call last):
File "G:/experiments/FFHQ-Aging-Dataset-master/download_ffhq_aging.py", line 377, in
run_cmdline(sys.argv)
File "G:/experiments/FFHQ-Aging-Dataset-master/download_ffhq_aging.py", line 372, in run_cmdline
run(**vars(args))
File "G:/experiments/FFHQ-Aging-Dataset-master/download_ffhq_aging.py", line 327, in run
drive = pydrive_utils.create_drive_manager(cmd_auth)
File "G:\experiments\FFHQ-Aging-Dataset-master\pydrive_utils.py", line 12, in create_drive_manager
gAuth.CommandLineAuth()
File "E:\Anaconda\lib\site-packages\pydrive\auth.py", line 125, in decorated
self.Auth(code)
File "E:\Anaconda\lib\site-packages\pydrive\auth.py", line 495, in Auth
self.Authenticate(code)
File "E:\Anaconda\lib\site-packages\pydrive\auth.py", line 508, in Authenticate
self.credentials = self.flow.step2_exchange(code)
File "E:\Anaconda\lib\site-packages\oauth2client_helpers.py", line 133, in positional_wrapper
return wrapped(*args, **kwargs)
File "E:\Anaconda\lib\site-packages\oauth2client\client.py", line 2054, in step2_exchange
http, self.token_uri, method='POST', body=body, headers=headers)
File "E:\Anaconda\lib\site-packages\oauth2client\transport.py", line 282, in request
connection_type=connection_type)
File "E:\Anaconda\lib\site-packages\httplib2_init
.py", line 1994, in request
cachekey,
File "E:\Anaconda\lib\site-packages\httplib2_init_.py", line 1651, in request
conn, request_uri, method, body, headers
File "E:\Anaconda\lib\site-packages\httplib2_init
.py", line 1557, in conn_request
conn.connect()
File "E:\Anaconda\lib\site-packages\httplib2_init
.py", line 1391, in connect
raise socket_err
File "E:\Anaconda\lib\site-packages\httplib2_init_.py", line 1326, in connect
self.sock = self._context.wrap_socket(sock, server_hostname=self.host)
File "E:\Anaconda\lib\ssl.py", line 407, in wrap_socket
_context=self, _session=session)
File "E:\Anaconda\lib\ssl.py", line 814, in init
self.do_handshake()
File "E:\Anaconda\lib\ssl.py", line 1068, in do_handshake
self._sslobj.do_handshake()
File "E:\Anaconda\lib\ssl.py", line 689, in do_handshake
self._sslobj.do_handshake()
ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。

Process finished with exit code 1

@royorel
Copy link
Owner

royorel commented Dec 3, 2020

@cscss it looks like pydrive can't connect to your google drive account for some reason. I will try to look into that and figure out what causes it. My main assumption is that it some sort of permissions issues in your google drive account that block the connection. I will try to give a more detailed answer once I sort this out.

@royorel
Copy link
Owner

royorel commented Dec 3, 2020

@cscss In the meantime please verify that you have followed steps 1 & 2 in the download with pydrive section in the readme file

@cscss
Copy link
Author

cscss commented Dec 3, 2020

Thanks, I will check it. And if you find the solution, I will always be online.

@cscss
Copy link
Author

cscss commented Dec 3, 2020

Hi. Because I want to download the dataset on my own computer(with display), I try to set args.cmd_auth=False. And it occurs a familiar question. Details are as follows, may be this can help solve the problem? And I could try to find another computer to download the dataset to check if my computer went wrong.

Traceback (most recent call last):
File "download_ffhq_aging.py", line 377, in
run_cmdline(sys.argv)
File "download_ffhq_aging.py", line 372, in run_cmdline
run(**vars(args))
File "download_ffhq_aging.py", line 327, in run
drive = pydrive_utils.create_drive_manager(cmd_auth)
File "G:\experiments\FFHQ-Aging-Dataset-master\pydrive_utils.py", line 14, in create_drive_manager
gAuth.LocalWebserverAuth()
File "E:\Anaconda\lib\site-packages\pydrive\auth.py", line 125, in decorated
self.Auth(code)
File "E:\Anaconda\lib\site-packages\pydrive\auth.py", line 495, in Auth
self.Authenticate(code)
File "E:\Anaconda\lib\site-packages\pydrive\auth.py", line 508, in Authenticate
self.credentials = self.flow.step2_exchange(code)
File "E:\Anaconda\lib\site-packages\oauth2client_helpers.py", line 133, in positional_wrapper
return wrapped(*args, **kwargs)
File "E:\Anaconda\lib\site-packages\oauth2client\client.py", line 2054, in step2_exchange
http, self.token_uri, method='POST', body=body, headers=headers)
File "E:\Anaconda\lib\site-packages\oauth2client\transport.py", line 282, in request
connection_type=connection_type)
File "E:\Anaconda\lib\site-packages\httplib2_init
.py", line 1994, in request
cachekey,
File "E:\Anaconda\lib\site-packages\httplib2_init_.py", line 1651, in request
conn, request_uri, method, body, headers
File "E:\Anaconda\lib\site-packages\httplib2_init
.py", line 1557, in conn_request
conn.connect()
File "E:\Anaconda\lib\site-packages\httplib2_init
.py", line 1391, in connect
raise socket_err
File "E:\Anaconda\lib\site-packages\httplib2_init_.py", line 1324, in connect
sock.connect((self.host, self.port))
TimeoutError: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。

@royorel
Copy link
Owner

royorel commented Dec 4, 2020

@cscss This time the program passed the authentication procedure but failed when it tried to establish a connection with your google drive, whereas previously the authentication procedure failed. The timeout error implies some sort of web connection issues. It seems like this problem is related to your machine setup (e.g. your network connection or firewall settings) than it is to an issue with the code itself.

The is the closest thing I could find on the web to the problem you're describing is this:
googlearchive/PyDrive#109

But I'm not sure if the root cause is exactly the same

@cscss
Copy link
Author

cscss commented Dec 4, 2020

Thanks for your help! But I still did not solve this problem. Forgive my impoliteness, do you have a web link for the dataset? Or could you please give me a link to download the dataset directly?

@royorel
Copy link
Owner

royorel commented Dec 4, 2020

Unfortunately, we do not host the dataset on any of our servers and cannot redistribute it in order to not violate any of the image licenses. For the same reason, our code is designed to download the images directly from NVIDIA's google drive and not from any of our servers.

I will still try to see if I can help you with your issue and will update as soon as I find a solution.

Once again, I'm sorry for not being able to share the finalized dataset.

@huangqiusheng
Copy link

感谢您的回复。我在winodws中运行download_ffhq_aging.py并设置args.resolution = 256,args.pydrive = True,args.cmd_auth = True
完整错误如下:
在浏览器中转到以下链接:

https://accounts.google.com/o/oauth2/auth?client_id=134667004926-vo5t13kj8pdjm32lqg3b9r2mcc8p7naa.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&access_type=offline&response_type=code

输入验证码:4 / 1AY0e-g7BVyUGA3TsxyXGf6anW2L9RYWJ_hi-2RF0orleNNbl2h7rqLG6Gm0
回溯(最近通话最后一个):
文件“G:/experiments/FFHQ-Aging-Dataset-master/download_ffhq_aging.py”,线路377,在
run_cmdline(sys.argv中)
文件“ G:/experiments/FFHQ-Aging-Dataset-master/download_ffhq_aging.py”,第372行,位于run_cmdline
run(** vars(args))
文件“ G:/ experiments / FFHQ-Aging-Dataset-master / download_ffhq_aging”中。 py”,运行
驱动器中的第327行= pydrive_utils.create_drive_manager(cmd_auth)
文件“ G:\ experiments \ FFHQ-Aging-Dataset-master \ pydrive_utils.py”,行12,位于create_drive_manager
gAuth.CommandLineAuth()
文件中,“ E: \ Anaconda \ lib \ site-packages \ pydrive \ auth.py“,第125行,在_装饰 self.Auth(代码) 文件“E:\蟒蛇\ LIB \站点包\ pydrive \ auth.py”,线路495,在验证 self.Authenticate(代码) 文件“E:\蟒蛇\ LIB \站点包\ pydrive \ auth.py”,第508行,在“验证 self.credentials = self.flow.step2_exchange(code)” 文件中的文件“ E:\ Anaconda \ lib \ site-packages \ oauth2client_helpers.py”,第133行,在positional_wrapper中 返回包装( * args,** kwargs) 文件“ E:\ Anaconda \ lib \ site-packages \ oauth2client \ client.py”,第2054行,在step2_exchange http,self.token_uri,method ='POST',body = body,headers =标头) 文件“ E:\ Anaconda \ lib \ site-packages \ oauth2client \ transport.py”,行282,在请求中 connection_type = connection_type) 文件“ E:\ Anaconda \ lib \ site-packages \ httplib2_ init_“ .py”,行1994,在请求
缓存键中,
文件“ E:\ Anaconda \ lib \ site-packages \ httplib2_ init _.py”,行1651,在_请求 conn,request_uri,方法,主体,头 文件中,“ E:_在_conn_request conn.connect()中的___1557行中的_Anaconda \ lib \ site-packages \ httplib2 init .py“,行1557,在_连接中__引发 “ __so _:\ Anaconda \ lib \ site-packages \ httplib2 _init .py”,行1391,在连接中
引发socket_err在连接 self.sock = self.context.wrap_socket(sock,server_hostname = self.host)中的 文件“ E:\ Anaconda
lib \ site-packages \ httplib2
init _.py”,行1326中,文件“ E:\ Anaconda \ lib \ ssl.py”,第407行,在wrap_socket中

_context =自,_session =会话)
文件“E:\阿纳康达\ lib中\ ssl.py”,线路814,在初始化
self.do_handshake()
文件“E:\阿纳康达\ lib中\ ssl.py”,线1068,在do_handshake
self._sslobj.do_handshake()
文件“E:\阿纳康达\ lib中\ ssl.py”,线路689,在do_handshake
self._sslobj.do_handshake()
ConnectionResetError:[10054 WinError]远程主机强迫关闭了一个现有的连接。

流程以退出代码1完成

Hi, I seem to have the same problem as you. I want to ask, how can this be solved? Also, if you have already obtained the data set, can you share it directly in the cloud disk? Thank you very much for your help

@xuedue
Copy link

xuedue commented Apr 14, 2021

感谢您的回复。我在winodws中运行download_ffhq_aging.py并设置args.resolution = 256,args.pydrive = True,args.cmd_auth = True
完整错误如下:
在浏览器中转到以下链接:

https://accounts.google.com/o/oauth2/auth?client_id=134667004926-vo5t13kj8pdjm32lqg3b9r2mcc8p7naa.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&access_type=offline&response_type=code

输入验证码:4 / 1AY0e-g7BVyUGA3TsxyXGf6anW2L9RYWJ_hi-2RF0orleNNbl2h7rqLG6Gm0
回溯(最近通话最后一个):
文件“G:/experiments/FFHQ-Aging-Dataset-master/download_ffhq_aging.py”,线路377,在
run_cmdline(sys.argv中)
文件“ G:/experiments/FFHQ-Aging-Dataset-master/download_ffhq_aging.py”,第372行,位于run_cmdline
run(** vars(args))
文件“ G:/ experiments / FFHQ-Aging-Dataset-master / download_ffhq_aging”中。 py”,运行
驱动器中的第327行= pydrive_utils.create_drive_manager(cmd_auth)
文件“ G:\ experiments \ FFHQ-Aging-Dataset-master \ pydrive_utils.py”,行12,位于create_drive_manager
gAuth.CommandLineAuth()
文件中,“ E: \ Anaconda \ lib \ site-packages \ pydrive \ auth.py“,第125行,在_装饰 self.Auth(代码) 文件“E:\蟒蛇\ LIB \站点包\ pydrive \ auth.py”,线路495,在验证 self.Authenticate(代码) 文件“E:\蟒蛇\ LIB \站点包\ pydrive \ auth.py”,第508行,在“验证 self.credentials = self.flow.step2_exchange(code)” 文件中的文件“ E:\ Anaconda \ lib \ site-packages \ oauth2client_helpers.py”,第133行,在positional_wrapper中 返回包装( * args,** kwargs) 文件“ E:\ Anaconda \ lib \ site-packages \ oauth2client \ client.py”,第2054行,在step2_exchange http,self.token_uri,method ='POST',body = body,headers =标头) 文件“ E:\ Anaconda \ lib \ site-packages \ oauth2client \ transport.py”,行282,在请求中 connection_type = connection_type) 文件“ E:\ Anaconda \ lib \ site-packages \ httplib2_ init_“ .py”,行1994,在请求
缓存键中,
文件“ E:\ Anaconda \ lib \ site-packages \ httplib2_ init _.py”,行1651,在_请求 conn,request_uri,方法,主体,头 文件中,“ E:_在_conn_request conn.connect()中的___1557行中的_Anaconda \ lib \ site-packages \ httplib2 init .py“,行1557,在_连接中__引发 “ __so _:\ Anaconda \ lib \ site-packages \ httplib2 _init .py”,行1391,在连接中
引发socket_err在连接 self.sock = self.context.wrap_socket(sock,server_hostname = self.host)中的 文件“ E:\ Anaconda
lib \ site-packages \ httplib2
init _.py”,行1326中,文件“ E:\ Anaconda \ lib \ ssl.py”,第407行,在wrap_socket中
_context =自,_session =会话)
文件“E:\阿纳康达\ lib中\ ssl.py”,线路814,在初始化
self.do_handshake()
文件“E:\阿纳康达\ lib中\ ssl.py”,线1068,在do_handshake
self._sslobj.do_handshake()
文件“E:\阿纳康达\ lib中\ ssl.py”,线路689,在do_handshake
self._sslobj.do_handshake()
ConnectionResetError:[10054 WinError]远程主机强迫关闭了一个现有的连接。
流程以退出代码1完成

Hi, I seem to have the same problem as you. I want to ask, how can this be solved? Also, if you have already obtained the data set, can you share it directly in the cloud disk? Thank you very much for your help

I have the same problem as you. And I still can't sovle it. Have you solve this problem or get the data set?

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

4 participants