haofanwang / ControlNet-for-Diffusers

Transfer the ControlNet with any basemodel in diffusers🔥
MIT License
813 stars 48 forks source link

TimeoutError: [Errno 110] Connection timed out when convert model into diffusers #14

Closed zihaog0724 closed 1 year ago

zihaog0724 commented 1 year ago

hi,

I'm following the README instruction strictly to convert control into diffusers-model. when i do python ./scripts/convert_controlnet_to_diffusers.py --checkpoint_path control_any3_openpose.pth --dump_path control_any3_openpose --device cpu

i got

global_step key not found in model
Traceback (most recent call last):
  File "/data/gpu_env_common/env/anaconda3/envs/controlnet_diffusers/lib/python3.8/site-packages/urllib3/connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
  File "/data/gpu_env_common/env/anaconda3/envs/controlnet_diffusers/lib/python3.8/site-packages/urllib3/connectionpool.py", line 386, in _make_request
    self._validate_conn(conn)
  File "/data/gpu_env_common/env/anaconda3/envs/controlnet_diffusers/lib/python3.8/site-packages/urllib3/connectionpool.py", line 1042, in _validate_conn
    conn.connect()
  File "/data/gpu_env_common/env/anaconda3/envs/controlnet_diffusers/lib/python3.8/site-packages/urllib3/connection.py", line 414, in connect
    self.sock = ssl_wrap_socket(
  File "/data/gpu_env_common/env/anaconda3/envs/controlnet_diffusers/lib/python3.8/site-packages/urllib3/util/ssl_.py", line 449, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(
  File "/data/gpu_env_common/env/anaconda3/envs/controlnet_diffusers/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 "/data/gpu_env_common/env/anaconda3/envs/controlnet_diffusers/lib/python3.8/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/data/gpu_env_common/env/anaconda3/envs/controlnet_diffusers/lib/python3.8/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/data/gpu_env_common/env/anaconda3/envs/controlnet_diffusers/lib/python3.8/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/data/gpu_env_common/env/anaconda3/envs/controlnet_diffusers/lib/python3.8/site-packages/requests/adapters.py", line 489, in send
    resp = conn.urlopen(
  File "/data/gpu_env_common/env/anaconda3/envs/controlnet_diffusers/lib/python3.8/site-packages/urllib3/connectionpool.py", line 787, in urlopen
    retries = retries.increment(
  File "/data/gpu_env_common/env/anaconda3/envs/controlnet_diffusers/lib/python3.8/site-packages/urllib3/util/retry.py", line 550, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/data/gpu_env_common/env/anaconda3/envs/controlnet_diffusers/lib/python3.8/site-packages/urllib3/packages/six.py", line 769, in reraise
    raise value.with_traceback(tb)
  File "/data/gpu_env_common/env/anaconda3/envs/controlnet_diffusers/lib/python3.8/site-packages/urllib3/connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
  File "/data/gpu_env_common/env/anaconda3/envs/controlnet_diffusers/lib/python3.8/site-packages/urllib3/connectionpool.py", line 386, in _make_request
    self._validate_conn(conn)
  File "/data/gpu_env_common/env/anaconda3/envs/controlnet_diffusers/lib/python3.8/site-packages/urllib3/connectionpool.py", line 1042, in _validate_conn
    conn.connect()
  File "/data/gpu_env_common/env/anaconda3/envs/controlnet_diffusers/lib/python3.8/site-packages/urllib3/connection.py", line 414, in connect
    self.sock = ssl_wrap_socket(
  File "/data/gpu_env_common/env/anaconda3/envs/controlnet_diffusers/lib/python3.8/site-packages/urllib3/util/ssl_.py", line 449, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(
  File "/data/gpu_env_common/env/anaconda3/envs/controlnet_diffusers/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 "/data/gpu_env_common/env/anaconda3/envs/controlnet_diffusers/lib/python3.8/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/data/gpu_env_common/env/anaconda3/envs/controlnet_diffusers/lib/python3.8/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/data/gpu_env_common/env/anaconda3/envs/controlnet_diffusers/lib/python3.8/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
urllib3.exceptions.ProtocolError: ('Connection aborted.', TimeoutError(110, 'Connection timed out'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./scripts/convert_controlnet_to_diffusers.py", line 105, in <module>
    pipe = load_pipeline_from_control_net_ckpt(
  File "/data/gpu_env_common/env/anaconda3/envs/controlnet_diffusers/lib/python3.8/site-packages/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py", line 1469, in load_pipeline_from_control_net_ckpt
    r = requests.get(
  File "/data/gpu_env_common/env/anaconda3/envs/controlnet_diffusers/lib/python3.8/site-packages/requests/api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
  File "/data/gpu_env_common/env/anaconda3/envs/controlnet_diffusers/lib/python3.8/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "/data/gpu_env_common/env/anaconda3/envs/controlnet_diffusers/lib/python3.8/site-packages/requests/sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
  File "/data/gpu_env_common/env/anaconda3/envs/controlnet_diffusers/lib/python3.8/site-packages/requests/sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
  File "/data/gpu_env_common/env/anaconda3/envs/controlnet_diffusers/lib/python3.8/site-packages/requests/adapters.py", line 547, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', TimeoutError(110, 'Connection timed out'))

Thanks for any help.

haofanwang commented 1 year ago

Hi, young CMUer! @zihaog0724

It seems to be a problem of your network. The following line fails to download.

r = requests.get(
    "https://raw.githubusercontent.com/lllyasviel/ControlNet/main/models/cldm_v15.yaml"
)
zihaog0724 commented 1 year ago

@haofanwang Yes, there was an issue about the network. I've downloaded the yaml file manually. Thanks CMUer go tartans!