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

Ubuntu:22.04 64位、Cuda版本:12.4.1、Python:3.10,部署Web启动报错 #781

Open
liujunyang0919 opened this issue Dec 24, 2024 · 1 comment

Comments

@liujunyang0919
Copy link

Traceback (most recent call last):
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/pydoc.py", line 439, in safeimport
module = import(path)
File "/root/CosyVoice/cosyvoice/flow/flow_matching.py", line 17, in
from matcha.models.components.flow_matching import BASECFM
File "/root/CosyVoice/third_party/Matcha-TTS/matcha/models/components/flow_matching.py", line 6, in
from matcha.models.components.decoder import Decoder
File "/root/CosyVoice/third_party/Matcha-TTS/matcha/models/components/decoder.py", line 8, in
from diffusers.models.activations import get_activation
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/diffusers/init.py", line 5, in
from .utils import (
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/diffusers/utils/init.py", line 38, in
from .dynamic_modules_utils import get_class_from_dynamic_module
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/diffusers/utils/dynamic_modules_utils.py", line 28, in
from huggingface_hub import cached_download, hf_hub_download, model_info
ImportError: cannot import name 'cached_download' from 'huggingface_hub' (/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/huggingface_hub/init.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/root/CosyVoice/webui.py", line 184, in
cosyvoice = CosyVoice2(args.model_dir) if 'CosyVoice2' in args.model_dir else CosyVoice(args.model_dir)
File "/root/CosyVoice/cosyvoice/cli/cosyvoice.py", line 33, in init
configs = load_hyperpyyaml(f)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/hyperpyyaml/core.py", line 188, in load_hyperpyyaml
hparams = yaml.load(yaml_stream, Loader=loader)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/yaml/init.py", line 81, in load
return loader.get_single_data()
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/ruamel/yaml/constructor.py", line 116, in get_single_data
return self.construct_document(node)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/ruamel/yaml/constructor.py", line 120, in construct_document
data = self.construct_object(node)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/ruamel/yaml/constructor.py", line 147, in construct_object
data = self.construct_non_recursive_object(node)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/ruamel/yaml/constructor.py", line 188, in construct_non_recursive_object
for _dummy in generator:
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/ruamel/yaml/constructor.py", line 633, in construct_yaml_map
value = self.construct_mapping(node)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/ruamel/yaml/constructor.py", line 429, in construct_mapping
return BaseConstructor.construct_mapping(self, node, deep=deep)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/ruamel/yaml/constructor.py", line 244, in construct_mapping
value = self.construct_object(value_node, deep=deep)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/ruamel/yaml/constructor.py", line 147, in construct_object
data = self.construct_non_recursive_object(node)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/ruamel/yaml/constructor.py", line 183, in construct_non_recursive_object
data = constructor(self, tag_suffix, node)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/hyperpyyaml/core.py", line 480, in _construct_object
args, kwargs = _load_node(loader, node)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/hyperpyyaml/core.py", line 434, in _load_node
kwargs = loader.construct_mapping(node, deep=True)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/ruamel/yaml/constructor.py", line 429, in construct_mapping
return BaseConstructor.construct_mapping(self, node, deep=deep)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/ruamel/yaml/constructor.py", line 244, in construct_mapping
value = self.construct_object(value_node, deep=deep)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/ruamel/yaml/constructor.py", line 147, in construct_object
data = self.construct_non_recursive_object(node)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/ruamel/yaml/constructor.py", line 183, in construct_non_recursive_object
data = constructor(self, tag_suffix, node)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/hyperpyyaml/core.py", line 470, in construct_object
callable
= pydoc.locate(callable_string)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/pydoc.py", line 1719, in locate
nextmodule = safeimport('.'.join(parts[:n+1]), forceload)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/pydoc.py", line 454, in safeimport
raise ErrorDuringImport(path, sys.exc_info())
pydoc.ErrorDuringImport: problem in cosyvoice.flow.flow_matching - ImportError: cannot import name 'cached_download' from 'huggingface_hub' (/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/huggingface_hub/init.py)
(cosyvoice) root@iZbp188pe16rhhu1bsrpqoZ:/CosyVoice# ^C
(cosyvoice) root@iZbp188pe16rhhu1bsrpqoZ:
/CosyVoice# export PYTHONPATH=third_party/Matcha-TTS
(cosyvoice) root@iZbp188pe16rhhu1bsrpqoZ:~/CosyVoice# python3 webui.py --port 50000 --model_dir pretrained_models/CosyVoice-300M
2024-12-24 16:21:49,538 - modelscope - INFO - PyTorch version 2.3.1+cu121 Found.
2024-12-24 16:21:49,539 - modelscope - INFO - Loading ast index from /root/.cache/modelscope/ast_indexer
2024-12-24 16:21:49,565 - modelscope - INFO - Loading done! Current index file version is 1.15.0, with md5 3ce5ade1142f68ac3b09c2102132cae5 and a total number of 980 components indexed
Traceback (most recent call last):
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/pydoc.py", line 439, in safeimport
module = import(path)
File "/root/CosyVoice/cosyvoice/flow/flow_matching.py", line 17, in
from matcha.models.components.flow_matching import BASECFM
File "/root/CosyVoice/third_party/Matcha-TTS/matcha/models/components/flow_matching.py", line 6, in
from matcha.models.components.decoder import Decoder
File "/root/CosyVoice/third_party/Matcha-TTS/matcha/models/components/decoder.py", line 8, in
from diffusers.models.activations import get_activation
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/diffusers/init.py", line 5, in
from .utils import (
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/diffusers/utils/init.py", line 38, in
from .dynamic_modules_utils import get_class_from_dynamic_module
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/diffusers/utils/dynamic_modules_utils.py", line 28, in
from huggingface_hub import cached_download, hf_hub_download, model_info
ImportError: cannot import name 'cached_download' from 'huggingface_hub' (/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/huggingface_hub/init.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/root/CosyVoice/webui.py", line 184, in
cosyvoice = CosyVoice2(args.model_dir) if 'CosyVoice2' in args.model_dir else CosyVoice(args.model_dir)
File "/root/CosyVoice/cosyvoice/cli/cosyvoice.py", line 33, in init
configs = load_hyperpyyaml(f)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/hyperpyyaml/core.py", line 188, in load_hyperpyyaml
hparams = yaml.load(yaml_stream, Loader=loader)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/yaml/init.py", line 81, in load
return loader.get_single_data()
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/ruamel/yaml/constructor.py", line 116, in get_single_data
return self.construct_document(node)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/ruamel/yaml/constructor.py", line 120, in construct_document
data = self.construct_object(node)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/ruamel/yaml/constructor.py", line 147, in construct_object
data = self.construct_non_recursive_object(node)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/ruamel/yaml/constructor.py", line 188, in construct_non_recursive_object
for _dummy in generator:
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/ruamel/yaml/constructor.py", line 633, in construct_yaml_map
value = self.construct_mapping(node)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/ruamel/yaml/constructor.py", line 429, in construct_mapping
return BaseConstructor.construct_mapping(self, node, deep=deep)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/ruamel/yaml/constructor.py", line 244, in construct_mapping
value = self.construct_object(value_node, deep=deep)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/ruamel/yaml/constructor.py", line 147, in construct_object
data = self.construct_non_recursive_object(node)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/ruamel/yaml/constructor.py", line 183, in construct_non_recursive_object
data = constructor(self, tag_suffix, node)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/hyperpyyaml/core.py", line 480, in _construct_object
args, kwargs = _load_node(loader, node)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/hyperpyyaml/core.py", line 434, in _load_node
kwargs = loader.construct_mapping(node, deep=True)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/ruamel/yaml/constructor.py", line 429, in construct_mapping
return BaseConstructor.construct_mapping(self, node, deep=deep)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/ruamel/yaml/constructor.py", line 244, in construct_mapping
value = self.construct_object(value_node, deep=deep)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/ruamel/yaml/constructor.py", line 147, in construct_object
data = self.construct_non_recursive_object(node)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/ruamel/yaml/constructor.py", line 183, in construct_non_recursive_object
data = constructor(self, tag_suffix, node)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/hyperpyyaml/core.py", line 470, in construct_object
callable
= pydoc.locate(callable_string)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/pydoc.py", line 1719, in locate
nextmodule = safeimport('.'.join(parts[:n+1]), forceload)
File "/root/miniconda3/envs/cosyvoice/lib/python3.10/pydoc.py", line 454, in safeimport
raise ErrorDuringImport(path, sys.exc_info())
pydoc.ErrorDuringImport: problem in cosyvoice.flow.flow_matching - ImportError: cannot import name 'cached_download' from 'huggingface_hub' (/root/miniconda3/envs/cosyvoice/lib/python3.10/site-packages/huggingface_hub/init.py)

@shirubei
Copy link

从 ImportError: cannot import name 'cached_download' from 'huggingface_hub' 看估计是包的版本不匹配吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants