hpcaitech / Open-Sora

Open-Sora: Democratizing Efficient Video Production for All
https://hpcaitech.github.io/Open-Sora/
Apache License 2.0
20.87k stars 1.98k forks source link

推理报错 #578

Open tohneecao opened 2 weeks ago

tohneecao commented 2 weeks ago

/opt/conda/envs/pytorch/lib/python3.9/site-packages/huggingface_hub/file_download.py:1132: FutureWarning: resume_download is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use force_download=True. warnings.warn( Traceback (most recent call last): File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/urllib3/connection.py", line 196, in _new_conn sock = connection.create_connection( File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/urllib3/util/connection.py", line 85, in create_connection raise err File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/urllib3/util/connection.py", line 73, in create_connection sock.connect(sa) socket.timeout: timed out

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/urllib3/connectionpool.py", line 789, in urlopen response = self._make_request( File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/urllib3/connectionpool.py", line 490, in _make_request raise new_e File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/urllib3/connectionpool.py", line 466, in _make_request self._validate_conn(conn) File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/urllib3/connectionpool.py", line 1095, in _validate_conn conn.connect() File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/urllib3/connection.py", line 615, in connect self.sock = sock = self._new_conn() File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/urllib3/connection.py", line 205, in _new_conn raise ConnectTimeoutError( urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x7eff438459d0>, 'Connection to huggingface.co timed out. (connect timeout=10)')

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/urllib3/connectionpool.py", line 843, in urlopen retries = retries.increment( File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/urllib3/util/retry.py", line 519, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /PixArt-alpha/pixart_sigma_sdxlvae_T5_diffusers/resolve/main/vae/config.json (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7eff438459d0>, 'Connection to huggingface.co timed out. (connect timeout=10)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/huggingface_hub/file_download.py", line 1722, in _get_metadata_or_catch_error metadata = get_hf_file_metadata(url=url, proxies=proxies, timeout=etag_timeout, headers=headers) File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn return fn(args, kwargs) File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/huggingface_hub/file_download.py", line 1645, in get_hf_file_metadata r = _request_wrapper( File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/huggingface_hub/file_download.py", line 372, in _request_wrapper response = _request_wrapper( File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/huggingface_hub/file_download.py", line 395, in _request_wrapper response = get_session().request(method=method, url=url, params) File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, send_kwargs) File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, kwargs) File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/huggingface_hub/utils/_http.py", line 66, in send return super().send(request, args, **kwargs) File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/requests/adapters.py", line 507, in send raise ConnectTimeout(e, request=request) requests.exceptions.ConnectTimeout: (MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /PixArt-alpha/pixart_sigma_sdxlvae_T5_diffusers/resolve/main/vae/config.json (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7eff438459d0>, 'Connection to huggingface.co timed out. (connect timeout=10)'))"), '(Request ID: 06db86fb-05ba-44be-b864-03685b79d330)')

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/diffusers/configuration_utils.py", line 380, in load_config config_file = hf_hub_download( File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn return fn(*args, **kwargs) File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/huggingface_hub/file_download.py", line 1221, in hf_hub_download return _hf_hub_download_to_cache_dir( File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/huggingface_hub/file_download.py", line 1325, in _hf_hub_download_to_cache_dir _raise_on_head_call_error(head_call_error, force_download, local_files_only) File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/huggingface_hub/file_download.py", line 1826, in _raise_on_head_call_error raise LocalEntryNotFoundError( huggingface_hub.utils._errors.LocalEntryNotFoundError: An error happened while trying to locate the file on the Hub and we cannot find the requested files in the local cache. Please check your connection and try again or make sure your Internet connection is on.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/workspace/Open-Sora/scripts/inference.py", line 303, in main() File "/workspace/Open-Sora/scripts/inference.py", line 77, in main vae = build_module(cfg.vae, MODELS).to(device, dtype).eval() File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/opensora/registry.py", line 24, in build_module return builder.build(cfg) File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/mmengine/registry/registry.py", line 570, in build return self.build_func(cfg, *args, kwargs, registry=self) File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/mmengine/registry/build_functions.py", line 121, in build_from_cfg obj = obj_cls(args) # type: ignore File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/opensora/models/vae/vae.py", line 281, in OpenSoraVAE_V1_2 model = VideoAutoencoderPipeline.from_pretrained(from_pretrained, kwargs) File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/transformers/modeling_utils.py", line 3462, in from_pretrained model = cls(config, *model_args, *model_kwargs) File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/opensora/models/vae/vae.py", line 153, in init self.spatial_vae = build_module(config.vae_2d, MODELS) File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/opensora/registry.py", line 24, in build_module return builder.build(cfg) File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/mmengine/registry/registry.py", line 570, in build return self.build_func(cfg, args, kwargs, registry=self) File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/mmengine/registry/build_functions.py", line 121, in build_from_cfg obj = obj_cls(args) # type: ignore File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/opensora/models/vae/vae.py", line 19, in init self.module = AutoencoderKL.from_pretrained( File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn return fn(*args, *kwargs) File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/diffusers/models/modeling_utils.py", line 567, in from_pretrained config, unused_kwargs, commit_hash = cls.load_config( File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn return fn(args, kwargs) File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/diffusers/configuration_utils.py", line 406, in load_config raise EnvironmentError( OSError: PixArt-alpha/pixart_sigma_sdxlvae_T5_diffusers does not appear to have a file named config.json.

看起来是还有下载什么模型。我已经根据sample.py里的写的三个模型提前下载到本地了

JThh commented 2 weeks ago

Can you set 'HF_HOME' to be the path holding your downloaded model?

timecoderr commented 2 weeks ago

您好 解决了吗 怎么解决的呢?

FrankLeeeee commented 2 weeks ago

Hi, may I know which config file you are using?

timecoderr commented 2 weeks ago

I have solved it by exporting a mirror HF_ENDPOINT=https://hf-mirror.com

FrankLeeeee commented 2 weeks ago

I have solved it by exporting a mirror HF_ENDPOINT=https://hf-mirror.com

It looks like that root cause that HF is banned in your region.

github-actions[bot] commented 6 days ago

This issue is stale because it has been open for 7 days with no activity.