custom-diffusion
custom-diffusion copied to clipboard
retrieve.py doesn't work
Hi!
when I executed finetune_real.sh
,
I faced the error below.
could you give me some advices to fix this?
Traceback (most recent call last):
File "/opt/conda/envs/ldm/lib/python3.8/site-packages/urllib3/connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "/opt/conda/envs/ldm/lib/python3.8/site-packages/urllib3/connectionpool.py", line 386, in _make_request
self._validate_conn(conn)
File "/opt/conda/envs/ldm/lib/python3.8/site-packages/urllib3/connectionpool.py", line 1042, in _validate_conn
conn.connect()
File "/opt/conda/envs/ldm/lib/python3.8/site-packages/urllib3/connection.py", line 414, in connect
self.sock = ssl_wrap_socket(
File "/opt/conda/envs/ldm/lib/python3.8/site-packages/urllib3/util/ssl_.py", line 449, in ssl_wrap_socket
ssl_sock = _ssl_wrap_socket_impl(
File "/opt/conda/envs/ldm/lib/python3.8/site-packages/urllib3/util/ssl_.py", line 493, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File "/opt/conda/envs/ldm/lib/python3.8/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "/opt/conda/envs/ldm/lib/python3.8/ssl.py", line 1040, in _create
self.do_handshake()
File "/opt/conda/envs/ldm/lib/python3.8/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ConnectionResetError: [Errno 104] Connection reset by peer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/conda/envs/ldm/lib/python3.8/site-packages/requests/adapters.py", line 489, in send
resp = conn.urlopen(
File "/opt/conda/envs/ldm/lib/python3.8/site-packages/urllib3/connectionpool.py", line 787, in urlopen
retries = retries.increment(
File "/opt/conda/envs/ldm/lib/python3.8/site-packages/urllib3/util/retry.py", line 550, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/opt/conda/envs/ldm/lib/python3.8/site-packages/urllib3/packages/six.py", line 769, in reraise
raise value.with_traceback(tb)
File "/opt/conda/envs/ldm/lib/python3.8/site-packages/urllib3/connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "/opt/conda/envs/ldm/lib/python3.8/site-packages/urllib3/connectionpool.py", line 386, in _make_request
self._validate_conn(conn)
File "/opt/conda/envs/ldm/lib/python3.8/site-packages/urllib3/connectionpool.py", line 1042, in _validate_conn
conn.connect()
File "/opt/conda/envs/ldm/lib/python3.8/site-packages/urllib3/connection.py", line 414, in connect
self.sock = ssl_wrap_socket(
File "/opt/conda/envs/ldm/lib/python3.8/site-packages/urllib3/util/ssl_.py", line 449, in ssl_wrap_socket
ssl_sock = _ssl_wrap_socket_impl(
File "/opt/conda/envs/ldm/lib/python3.8/site-packages/urllib3/util/ssl_.py", line 493, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File "/opt/conda/envs/ldm/lib/python3.8/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "/opt/conda/envs/ldm/lib/python3.8/ssl.py", line 1040, in _create
self.do_handshake()
File "/opt/conda/envs/ldm/lib/python3.8/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "src/retrieve.py", line 91, in <module>
retrieve(args.target_name, args.outpath, args.num_class_images)
File "src/retrieve.py", line 27, in retrieve
results = client.query(text=target_name)
File "/opt/conda/envs/ldm/lib/python3.8/site-packages/clip_retrieval/clip_client.py", line 84, in query
return self.__search_knn_api__(text=text)
File "/opt/conda/envs/ldm/lib/python3.8/site-packages/clip_retrieval/clip_client.py", line 131, in __search_knn_api__
return requests.post(
File "/opt/conda/envs/ldm/lib/python3.8/site-packages/requests/api.py", line 115, in post
return request("post", url, data=data, json=json, **kwargs)
File "/opt/conda/envs/ldm/lib/python3.8/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "/opt/conda/envs/ldm/lib/python3.8/site-packages/requests/sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "/opt/conda/envs/ldm/lib/python3.8/site-packages/requests/sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
File "/opt/conda/envs/ldm/lib/python3.8/site-packages/requests/adapters.py", line 547, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
Hi, The clip-retrieval dependency changed recently, which broke the code. I have updated the code and believe it should work now. Thanks to longlimin for pointing out the solution here.
Hi,
in my case, even the updated link for client doesn't work. I'm getting an error of type: "json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)"
Thus, I cannot generate the regularization images. Is there a way to fix this, please ? Thanks,
I am getting the same error as IemProg: "json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)"
Hi,
I believe there's some issue with the clip-retrieval library as mentioned here as well.
In the meantime, you can use finetune_gen.sh
or disable real_prior
if using diffusers.
Thanks.
Hi, I am getting the same error as IemProg and dbash: "requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)"
How can i fix this? Thanks!
Hi, I am also getting the same error as Vmnk : requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)" Please let me know how to fix this.
@IemProg @VMnK-Run @Aditi0912dec @nupurkmr9 Hi guys, I have the same issue. Did you address it?
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
May I ask if it has been resolved? I have also encountered the same problem
Hi, The clip-retrieval dependency changed recently, which broke the code. I have updated the code and believe it should work now. Thanks to longlimin for pointing out the solution here.
I remember it was resolved with this resolution.
Hi, The clip-retrieval dependency changed recently, which broke the code. I have updated the code and believe it should work now. Thanks to longlimin for pointing out the solution here.
I remember it was resolved with this resolution.
I followed his method and still encountered the same error. It seems that the link was closed, but I would like to ask if there are any replaceable links available
Hi, The clip-retrieval dependency changed recently, which broke the code. I have updated the code and believe it should work now. Thanks to longlimin for pointing out the solution here.
I remember it was resolved with this resolution.
I followed his method and still encountered the same error. It seems that the link was closed, but I would like to ask if there are any replaceable links available
Oh, yes you right. The link is broken again. Unfortunately, I don't have any idea about the link that can be replaced. sorry.