custom-diffusion icon indicating copy to clipboard operation
custom-diffusion copied to clipboard

retrieve.py doesn't work

Open yoon28 opened this issue 2 years ago • 11 comments

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'))

yoon28 avatar Feb 13 '23 14:02 yoon28

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.

nupurkmr9 avatar Feb 14 '23 05:02 nupurkmr9

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,

IemProg avatar Mar 01 '23 14:03 IemProg

I am getting the same error as IemProg: "json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)"

dbash avatar May 15 '23 18:05 dbash

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.

nupurkmr9 avatar May 20 '23 01:05 nupurkmr9

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!

VMnK-Run avatar May 25 '23 14:05 VMnK-Run

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.

Aditi0912dec avatar Jun 07 '23 03:06 Aditi0912dec

@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)

daeunni avatar Jan 23 '24 07:01 daeunni

May I ask if it has been resolved? I have also encountered the same problem

kuailexiaohunzi avatar Jun 11 '24 16:06 kuailexiaohunzi

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.

yoon28 avatar Jun 12 '24 00:06 yoon28

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

kuailexiaohunzi avatar Jun 12 '24 02:06 kuailexiaohunzi

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.

yoon28 avatar Jun 12 '24 02:06 yoon28