Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

urllib.error.URLError: <urlopen error [WinError 10060] #18

Open
lvyangshenchu opened this issue Dec 5, 2024 · 5 comments
Open

urllib.error.URLError: <urlopen error [WinError 10060] #18

lvyangshenchu opened this issue Dec 5, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@lvyangshenchu
Copy link

urllib.error.URLError: <urlopen error [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试 失败。>

请问这是什么原因造成的?

@lvyangshenchu lvyangshenchu added the enhancement New feature or request label Dec 5, 2024
@jhj0517
Copy link
Owner

jhj0517 commented Dec 5, 2024

Hi @lvyangshenchu, Unfortunately, this is not enough information to figure out what is wrong.
Can you post the full stack trace from the terminal?

Based on my research, WinError 10060 means some kind of network error.

I wonder what caused the network error in this WebUI?
I suspect it happened when you tried to automatically download the model from huggingface for the first time, maybe.

@lvyangshenchu
Copy link
Author

To create a public link, set share=True in launch().
C:\Users\15272\AdvancedLivePortrait-WebUI\models\appearance_feature_extractor.safetensors is not detected. Downloading model...
An unexpected error occurred during model download.
Traceback (most recent call last):
File "C:\Users\15272\AppData\Local\Programs\Python\Python312\Lib\urllib\request.py", line 1344, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "C:\Users\15272\AppData\Local\Programs\Python\Python312\Lib\http\client.py", line 1336, in request
self._send_request(method, url, body, headers, encode_chunked)
File "C:\Users\15272\AppData\Local\Programs\Python\Python312\Lib\http\client.py", line 1382, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "C:\Users\15272\AppData\Local\Programs\Python\Python312\Lib\http\client.py", line 1331, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Users\15272\AppData\Local\Programs\Python\Python312\Lib\http\client.py", line 1091, in _send_output
self.send(msg)
File "C:\Users\15272\AppData\Local\Programs\Python\Python312\Lib\http\client.py", line 1035, in send
self.connect()
File "C:\Users\15272\AppData\Local\Programs\Python\Python312\Lib\http\client.py", line 1470, in connect
super().connect()
File "C:\Users\15272\AppData\Local\Programs\Python\Python312\Lib\http\client.py", line 1001, in connect
self.sock = self._create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\15272\AppData\Local\Programs\Python\Python312\Lib\socket.py", line 853, in create_connection
raise exceptions[0]
File "C:\Users\15272\AppData\Local\Programs\Python\Python312\Lib\socket.py", line 838, in create_connection
sock.connect(sa)
TimeoutError: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\15272\AppData\Local\Programs\Python\Python312\Lib\site-packages\gradio\queueing.py", line 624, in process_events
response = await route_utils.call_process_api(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\15272\AppData\Local\Programs\Python\Python312\Lib\site-packages\gradio\route_utils.py", line 323, in call_process_api
output = await app.get_blocks().process_api(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\15272\AppData\Local\Programs\Python\Python312\Lib\site-packages\gradio\blocks.py", line 2043, in process_api
result = await self.call_function(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\15272\AppData\Local\Programs\Python\Python312\Lib\site-packages\gradio\blocks.py", line 1590, in call_function
prediction = await anyio.to_thread.run_sync( # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\15272\AppData\Local\Programs\Python\Python312\Lib\site-packages\anyio\to_thread.py", line 56, in run_sync
return await get_async_backend().run_sync_in_worker_thread(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\15272\AppData\Local\Programs\Python\Python312\Lib\site-packages\anyio_backends_asyncio.py", line 2441, in run_sync_in_worker_thread
return await future
^^^^^^^^^^^^
File "C:\Users\15272\AppData\Local\Programs\Python\Python312\Lib\site-packages\anyio_backends_asyncio.py", line 943, in run
result = context.run(func, *args)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\15272\AppData\Local\Programs\Python\Python312\Lib\site-packages\gradio\utils.py", line 865, in wrapper
response = f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^
File "C:\Users\15272\AdvancedLivePortrait-WebUI\modules\live_portrait\live_portrait_inferencer.py", line 173, in edit_expression
self.load_models(
File "C:\Users\15272\AdvancedLivePortrait-WebUI\modules\live_portrait\live_portrait_inferencer.py", line 86, in load_models
self.download_if_no_models(
File "C:\Users\15272\AdvancedLivePortrait-WebUI\modules\live_portrait\live_portrait_inferencer.py", line 365, in download_if_no_models
download_model(model_path, model_url)
File "C:\Users\15272\AdvancedLivePortrait-WebUI\modules\live_portrait\model_downloader.py", line 46, in download_model
raise e
File "C:\Users\15272\AdvancedLivePortrait-WebUI\modules\live_portrait\model_downloader.py", line 36, in download_model
download_url_to_file(url, file_path, progress=True)
File "C:\Users\15272\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch\hub.py", line 708, in download_url_to_file
u = urlopen(req)
^^^^^^^^^^^^
File "C:\Users\15272\AppData\Local\Programs\Python\Python312\Lib\urllib\request.py", line 215, in urlopen
return opener.open(url, data, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\15272\AppData\Local\Programs\Python\Python312\Lib\urllib\request.py", line 515, in open
response = self._open(req, data)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\15272\AppData\Local\Programs\Python\Python312\Lib\urllib\request.py", line 532, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\15272\AppData\Local\Programs\Python\Python312\Lib\urllib\request.py", line 492, in _call_chain
result = func(*args)
^^^^^^^^^^^
File "C:\Users\15272\AppData\Local\Programs\Python\Python312\Lib\urllib\request.py", line 1392, in https_open
return self.do_open(http.client.HTTPSConnection, req,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\15272\AppData\Local\Programs\Python\Python312\Lib\urllib\request.py", line 1347, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试 失败。>

Python 3.12.4 (tags/v3.12.4:8e8a4ba, Jun 6 2024, 19:30:16) [MSC v.1940 64 bit (AMD64)] on win32
thank you!

@jhj0517 jhj0517 added bug Something isn't working and removed enhancement New feature or request labels Dec 6, 2024
@jhj0517
Copy link
Owner

jhj0517 commented Dec 6, 2024

Thanks!

An unexpected error occurred during model download.

As I expected, this happens when you try to download the models programmatically.

For some reason, your network is not able to access this URL programatically :

As a workaround, you can manually download the models from huggingface & place them in your local directory.

  1. Download
1. appearance_feature_extractor.safetensors
2. motion_extractor.safetensors
3. spade_generator.safetensors
4. stitching_retargeting_module.safetensors
5. warping_module.safetensors

from https://huggingface.co/Kijai/LivePortrait_safetensors/tree/main and place them in "./models".

  1. Download
face_yolov8n.pt

from https://huggingface.co/Bingsu/adetailer/tree/main and place them in "./models".

The final model directory structure would look like this:

/AdvancedLivePortrait-WebUI
└── models
   ├── appearance_feature_extractor.safetensors
   ├── motion_extractor.safetensors
   ├── spade_generator.safetensors
   ├── stitching_retargeting_module.safetensors
   ├── warping_module.safetensors
   └── face_yolov8n.pt

@lvyangshenchu
Copy link
Author

Thank you, I have downloaded them and the new prompt is ”FileNotFoundError: [WinError 3] The system cannot find the specified path: '/tmp/ultralytics_runner'“

@jhj0517
Copy link
Owner

jhj0517 commented Dec 10, 2024

I tried to reproduce it, but I couldn't on my environment.

/tmp/ultralytics_runner

Recently ultralytics had some problem with PyPI - ultralytics/ultralytics#18027, maybe it was caused by it.

Can you reinstall ultralytics and try again?

pip install -U ultralytics==8.3.43

Note that this has to be done while you activating the venv.

If you don't know how to activate venv, follow this guide:

  1. Open your terminal
  2. Navigate to the project directory.
cd "/path/to/AdvancedLivePortrait-WebUI"
  1. Activate the virtual environment:
  • On Windows:
.\venv\Scripts\activate
  • On macOS/Linux:
source venv/bin/activate
  1. It will then display (venv) in front of the terminal. In this state, install ultralytics
(venv)  pip install -U ultralytics==8.3.43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants