Closed JasonChenhx closed 1 year ago
We do not use the socket in our codes. Is it the problem when you are using cloud computing resources?
I think i meet the same problem when i run test.py, and the error message is like :
Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connection.py", line 141, in _new_conn (self.host, self.port), self.timeout, **extra_kw) File "C:\ProgramData\Anaconda3\lib\site-packages\urllib3\util\connection.py", line 83, in create_connection raise err File "C:\ProgramData\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 "C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 601, in urlopen chunked=chunked) File "C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 357, in _make_request conn.request(method, url, **httplib_request_kw) File "C:\ProgramData\Anaconda3\lib\http\client.py", line 1239, in request self._send_request(method, url, body, headers, encode_chunked) File "C:\ProgramData\Anaconda3\lib\http\client.py", line 1285, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "C:\ProgramData\Anaconda3\lib\http\client.py", line 1234, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "C:\ProgramData\Anaconda3\lib\http\client.py", line 1026, in _send_output self.send(msg) File "C:\ProgramData\Anaconda3\lib\http\client.py", line 964, in send self.connect() File "C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connection.py", line 166, in connect conn = self._new_conn() File "C:\ProgramData\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 0x0000024A9250D160>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\site-packages\requests\adapters.py", line 440, in send timeout=timeout File "C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 639, in urlopen _stacktrace=sys.exc_info()[2]) File "C:\ProgramData\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/DeepCrack (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000024A9250D160>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。',))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\visdom__init.py", line 711, in _send
data=json.dumps(msg),
File "C:\ProgramData\Anaconda3\lib\site-packages\visdom__init__.py", line 677, in _handle_post
r = self.session.post(url, data=data)
File "C:\ProgramData\Anaconda3\lib\site-packages\requests\sessions.py", line 555, in post
return self.request('POST', url, data=data, json=json, kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\requests\sessions.py", line 508, in request
resp = self.send(prep, send_kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\requests\sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "C:\ProgramData\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/DeepCrack (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000024A9250D160>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。',))
Without the incoming socket you cannot receive events from the server or register event handlers to your Visdom client.
Loaded checkpoint: checkpoints/DeepCrack_CT260_FT1.pth
0it [00:00, ?it/s]
Traceback (most recent call last):
File "D:/火眼智能/裂缝检测/DeepCrack-master/codes/test.py", line 58, in
SOLVED. The problem is caused by visdom which is used for visualization. You need to type "python -m visdom.server" in Terminal and visit http://localhost:8097/ before you run test.py or train.py
I have tried a piece of code from Zhihu to solve this problem https://zhuanlan.zhihu.com/p/54389036?tdsourcetag=s_pctim_aiomsg The full code block is :
! npm install -g localtunnel
get_ipython().system_raw('python3 -m pip install visdom')
get_ipython().system_raw('python3 -m visdom.server -port 8097 >> visdomlog.txt 2>&1 &')
get_ipython().system_raw('lt --port 8097 >> url.txt 2>&1 &')
import time
time.sleep(5)
! cat url.txt
import visdom
time.sleep(5)
vis = visdom.Visdom(port='8097')
print(vis)
time.sleep(3)
vis.text('testing')
! cat visdomlog.txt
I try this code in colab and insert it before test.py. It solve the problem of socket connection error.
@ywx980615 thanks
SOLVED. The problem is caused by visdom which is used for visualization. You need to type "python -m visdom.server" in Terminal and visit http://localhost:8097/ before you run test.py or train.py
Hi, I did this. First, I called python -m visdom.server, then I clicked the http://localhost:8097/.
Then I kept this open and then opened another anaconda command prompt. It was running but gave one error message "ERROR:tornado.general:Could not open static file 'C:\Users\tamim\anaconda3\envs\DeepCrack_Master\lib\site-package". But it was running.
so, by keeping this on, I called train.py in the another anaconda command prompt. Then the message was that "Without the incoming socket you cannot receive events from the server or register event handlers to your Visdom client."
Can you please explain where I made the mistakes?
SOLVED. The problem is caused by visdom which is used for visualization. You need to type "python -m visdom.server" in Terminal and visit http://localhost:8097/ before you run test.py or train.py
Hi, I did this. First, I called python -m visdom.server, then I clicked the http://localhost:8097/.
Then I kept this open and then opened another anaconda command prompt. It was running but gave one error message "ERROR:tornado.general:Could not open static file 'C:\Users\tamim\anaconda3\envs\DeepCrack_Master\lib\site-package". But it was running.
so, by keeping this on, I called train.py in the another anaconda command prompt. Then the message was that "Without the incoming socket you cannot receive events from the server or register event handlers to your Visdom client."
Can you please explain where I made the mistakes?
I've no idea. Sorry it was a long time ago when i answered. Basically you need to run and visit visdom server before u train or test the model.
I don't know why I encountered this kind of problem. I checked the code and found that there is no code related to socket. Is it because the communication between multiple GPUs requires socket?