ConnectionRefusedError: [Errno 111] Connection refused

运行代码时出现以下错误:

raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8097): Max retries exceeded with url: /env/main (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused'))

 

1.检查是不是用到Visdom

 

2.检查是否运行了 python -m visdom.server

ConnectionRefusedError: [Errno 111] Connection refused_第1张图片

 

打开链接 http://localhost:8097

ConnectionRefusedError: [Errno 111] Connection refused_第2张图片
 

 

3.再打开一个命令窗口,输入自己所需的命令

比如这里,输入以下命令进行测试:

import visdom
vis = visdom.Visdom()

ConnectionRefusedError: [Errno 111] Connection refused_第3张图片

 

参考:https://github.com/facebookresearch/visdom/issues/484

你可能感兴趣的:(ConnectionRefusedError: [Errno 111] Connection refused)