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

Error connecting to Visdom server #405

Closed
frogprincel opened this issue Oct 17, 2018 · 10 comments
Closed

Error connecting to Visdom server #405

frogprincel opened this issue Oct 17, 2018 · 10 comments

Comments

@frogprincel
Copy link

I test the code on Windows. How can I run the "train.py" in Windows. Attached please find the issue:

---------- Networks initialized -------------
[Network G_A] Total number of parameters : 11.378 M
[Network G_B] Total number of parameters : 11.378 M
[Network D_A] Total number of parameters : 2.765 M
[Network D_B] Total number of parameters : 2.765 M
-----------------------------------------------
Traceback (most recent call last):
File "D:\Anaconda3\lib\site-packages\urllib3\connection.py", line 141, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "D:\Anaconda3\lib\site-packages\urllib3\util\connection.py", line 83, in create_connection
raise err
File "D:\Anaconda3\lib\site-packages\urllib3\util\connection.py", line 73, in create_connection
sock.connect(sa)
ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。

 During handling of the above exception, another exception occurred:
 
 Traceback (most recent call last):
   File "D:\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 601, in urlopen
     chunked=chunked)
   File "D:\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 357, in _make_request
     conn.request(method, url, **httplib_request_kw)
   File "D:\Anaconda3\lib\http\client.py", line 1239, in request
     self._send_request(method, url, body, headers, encode_chunked)
   File "D:\Anaconda3\lib\http\client.py", line 1285, in _send_request
     self.endheaders(body, encode_chunked=encode_chunked)
   File "D:\Anaconda3\lib\http\client.py", line 1234, in endheaders
     self._send_output(message_body, encode_chunked=encode_chunked)
   File "D:\Anaconda3\lib\http\client.py", line 1026, in _send_output
     self.send(msg)
   File "D:\Anaconda3\lib\http\client.py", line 964, in send
     self.connect()
   File "D:\Anaconda3\lib\site-packages\urllib3\connection.py", line 166, in connect
     conn = self._new_conn()
   File "D:\Anaconda3\lib\site-packages\urllib3\connection.py", line 150, in _new_conn
     self, "Failed to establish a new connection: %s" % e)
 urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x0000027CBE176208>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
 
 During handling of the above exception, another exception occurred:
 
 Traceback (most recent call last):
   File "D:\Anaconda3\lib\site-packages\requests\adapters.py", line 440, in send
     timeout=timeout
   File "D:\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 639, in urlopen
     _stacktrace=sys.exc_info()[2])
   File "D:\Anaconda3\lib\site-packages\urllib3\util\retry.py", line 388, in increment
     raise MaxRetryError(_pool, url, error or ResponseError(cause))
 urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8097): Max retries exceeded with url: /env/main (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000027CBE176208>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。',))
 
 During handling of the above exception, another exception occurred:
 
 Traceback (most recent call last):
   File "D:\Anaconda3\lib\site-packages\visdom\__init__.py", line 446, in _send
     data=json.dumps(msg),
   File "D:\Anaconda3\lib\site-packages\requests\api.py", line 112, in post
     return request('post', url, data=data, json=json, **kwargs)
   File "D:\Anaconda3\lib\site-packages\requests\api.py", line 58, in request
     return session.request(method=method, url=url, **kwargs)
   File "D:\Anaconda3\lib\site-packages\requests\sessions.py", line 508, in request
     resp = self.send(prep, **send_kwargs)
   File "D:\Anaconda3\lib\site-packages\requests\sessions.py", line 618, in send
     r = adapter.send(request, **kwargs)
   File "D:\Anaconda3\lib\site-packages\requests\adapters.py", line 508, in send
     raise ConnectionError(e, request=request)
 requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8097): Max retries exceeded with url: /env/main (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000027CBE176208>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。',))
 
 During handling of the above exception, another exception occurred:
 
 Traceback (most recent call last):
   File "train.py", line 16, in <module>
     visualizer = Visualizer(opt)
   File "E:\文档\我的文档\文献\科研\DMML\GAN\程序\pytorch-CycleGAN-and-pix2pix\util\visualizer.py", line 53, in __init__
     self.vis = visdom.Visdom(server=opt.display_server, port=opt.display_port, env=opt.display_env, raise_exceptions=True)
   File "D:\Anaconda3\lib\site-packages\visdom\__init__.py", line 327, in __init__
     }, endpoint='env/' + env)
   File "D:\Anaconda3\lib\site-packages\visdom\__init__.py", line 460, in _send
     raise ConnectionError("Error connecting to Visdom server")
 ConnectionError: Error connecting to Visdom server
@junyanz
Copy link
Owner

junyanz commented Oct 17, 2018

See this Q & A

@junyanz junyanz closed this as completed Nov 2, 2018
@guotong1988
Copy link

Same question. Thank you.

@junyanz
Copy link
Owner

junyanz commented Apr 9, 2019

Please refer to this Q & A.

@guotong1988
Copy link

Thank you very much!!! I have seen the link of 17 Oct 2018

@paviddavid
Copy link

@frogprincel @guotong1988 @junyanz I have the same question. However, I am not sure how to handle the visdom server.

I am using the docker container and if I execute

python -m visdom.server

the server starts as expected however, I am not sure how to continue. I can either enter something in the command line but it is not working nor stopping the visdom server. Could you please provide the order in which I have to call the functions?

Thanks a lot in advance!!!

@junyanz
Copy link
Owner

junyanz commented Jun 12, 2019

You need to run python -m visdom.server in a separate command panel. You can also run it as a background program.

@paviddavid
Copy link

@junyanz Thanks for your quick response.

I am working within your docker container. Is it necessary to start the visdom.server command from inside the docker container or is it ok to run it from another terminal?

(If I should run it inside a docker container, how do I get start two docker instances with the same image?)
Thanks a lot in advance for your support and best regards

@junyanz
Copy link
Owner

junyanz commented Jun 13, 2019

I haven't used docker that much. I leave your question to @taesungp

@paviddavid
Copy link

@junyanz Thanks a lot for your help. Hope @taesungp could give me some hints for this..

@paviddavid
Copy link

@junyanz (and everybody who might have the same problem)
Start a docker container as described in the repo. In a second terminal window, you should run docker exec -it <image name> bash. There it is possible to run the python -m visdom.server command as described and it works as expected.

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