Skip to content

ZeroDivisionError: 0.0 cannot be raised to a negative power #1183

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

Open
hjj-lmx opened this issue Apr 16, 2025 · 6 comments
Open

ZeroDivisionError: 0.0 cannot be raised to a negative power #1183

hjj-lmx opened this issue Apr 16, 2025 · 6 comments

Comments

@hjj-lmx
Copy link

hjj-lmx commented Apr 16, 2025

Traceback (most recent call last):
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in call_with_frames_removed
File "E:\Project\UD-AI-TextToSpeech\text_to_speech\server_gpu.py", line 36, in
clone_model = CosyVoice2(os.path.join("checkpoints", "CosyVoice2-0.5B"), True, True, True)
File "E:\Project\UD-AI-TextToSpeech\text_to_speech\cosyvoice\cli\cosyvoice.py", line 142, in init
configs = load_hyperpyyaml(f, overrides={'qwen_pretrain_path': os.path.join(model_dir, 'CosyVoice-BlankEN')})
File "D:\Program Files\miniconda3\envs\text_to_speech\lib\site-packages\hyperpyyaml\core.py", line 188, in load_hyperpyyaml
hparams = yaml.load(yaml_stream, Loader=loader)
File "D:\Program Files\miniconda3\envs\text_to_speech\lib\site-packages\yaml_init
.py", line 81, in load
return loader.get_single_data()
File "D:\Program Files\miniconda3\envs\text_to_speech\lib\site-packages\ruamel\yaml\constructor.py", line 116, in get_single_data
return self.construct_document(node)
File "D:\Program Files\miniconda3\envs\text_to_speech\lib\site-packages\ruamel\yaml\constructor.py", line 120, in construct_document
data = self.construct_object(node)
File "D:\Program Files\miniconda3\envs\text_to_speech\lib\site-packages\ruamel\yaml\constructor.py", line 147, in construct_object
data = self.construct_non_recursive_object(node)
File "D:\Program Files\miniconda3\envs\text_to_speech\lib\site-packages\ruamel\yaml\constructor.py", line 188, in construct_non_recursive_object
for _dummy in generator:
File "D:\Program Files\miniconda3\envs\text_to_speech\lib\site-packages\ruamel\yaml\constructor.py", line 633, in construct_yaml_map
value = self.construct_mapping(node)
File "D:\Program Files\miniconda3\envs\text_to_speech\lib\site-packages\ruamel\yaml\constructor.py", line 429, in construct_mapping
return BaseConstructor.construct_mapping(self, node, deep=deep)
File "D:\Program Files\miniconda3\envs\text_to_speech\lib\site-packages\ruamel\yaml\constructor.py", line 244, in construct_mapping
value = self.construct_object(value_node, deep=deep)
File "D:\Program Files\miniconda3\envs\text_to_speech\lib\site-packages\ruamel\yaml\constructor.py", line 147, in construct_object
data = self.construct_non_recursive_object(node)
File "D:\Program Files\miniconda3\envs\text_to_speech\lib\site-packages\ruamel\yaml\constructor.py", line 183, in construct_non_recursive_object
data = constructor(self, tag_suffix, node)
File "D:\Program Files\miniconda3\envs\text_to_speech\lib\site-packages\hyperpyyaml\core.py", line 480, in _construct_object
args, kwargs = _load_node(loader, node)
File "D:\Program Files\miniconda3\envs\text_to_speech\lib\site-packages\hyperpyyaml\core.py", line 434, in _load_node
kwargs = loader.construct_mapping(node, deep=True)
File "D:\Program Files\miniconda3\envs\text_to_speech\lib\site-packages\ruamel\yaml\constructor.py", line 429, in construct_mapping
return BaseConstructor.construct_mapping(self, node, deep=deep)
File "D:\Program Files\miniconda3\envs\text_to_speech\lib\site-packages\ruamel\yaml\constructor.py", line 244, in construct_mapping
value = self.construct_object(value_node, deep=deep)
File "D:\Program Files\miniconda3\envs\text_to_speech\lib\site-packages\ruamel\yaml\constructor.py", line 147, in construct_object
data = self.construct_non_recursive_object(node)
File "D:\Program Files\miniconda3\envs\text_to_speech\lib\site-packages\ruamel\yaml\constructor.py", line 183, in construct_non_recursive_object
data = constructor(self, tag_suffix, node)
File "D:\Program Files\miniconda3\envs\text_to_speech\lib\site-packages\hyperpyyaml\core.py", line 480, in _construct_object
args, kwargs = _load_node(loader, node)
File "D:\Program Files\miniconda3\envs\text_to_speech\lib\site-packages\hyperpyyaml\core.py", line 434, in _load_node
kwargs = loader.construct_mapping(node, deep=True)
File "D:\Program Files\miniconda3\envs\text_to_speech\lib\site-packages\ruamel\yaml\constructor.py", line 429, in construct_mapping
return BaseConstructor.construct_mapping(self, node, deep=deep)
File "D:\Program Files\miniconda3\envs\text_to_speech\lib\site-packages\ruamel\yaml\constructor.py", line 244, in construct_mapping
value = self.construct_object(value_node, deep=deep)
File "D:\Program Files\miniconda3\envs\text_to_speech\lib\site-packages\ruamel\yaml\constructor.py", line 147, in construct_object
data = self.construct_non_recursive_object(node)
File "D:\Program Files\miniconda3\envs\text_to_speech\lib\site-packages\ruamel\yaml\constructor.py", line 183, in construct_non_recursive_object
data = constructor(self, tag_suffix, node)
File "D:\Program Files\miniconda3\envs\text_to_speech\lib\site-packages\hyperpyyaml\core.py", line 481, in construct_object
return callable
(*args, kwargs)
File "E:\Project\UD-AI-TextToSpeech\text_to_speech\cosyvoice\flow\decoder.py", line 642, in init
[
File "E:\Project\UD-AI-TextToSpeech\text_to_speech\cosyvoice\flow\decoder.py", line 643, in
CausalBasicTransformerBlock(
File "E:\Project\UD-AI-TextToSpeech\text_to_speech\cosyvoice\flow\decoder.py", line 306, in init
self.attn1 = CausalAttention(
File "E:\Project\UD-AI-TextToSpeech\text_to_speech\cosyvoice\flow\decoder.py", line 230, in init
super(CausalAttention, self).init(query_dim, cross_attention_dim, heads, dim_head, dropout, bias, upcast_attention, upcast_softmax,
File "D:\Program Files\miniconda3\envs\text_to_speech\lib\site-packages\diffusers\models\attention_processor.py", line 166, in init
self.scale = dim_head
-0.5 if self.scale_qk else 1.0
ZeroDivisionError: 0.0 cannot be raised to a negative power

@aluminumbox
Copy link
Collaborator

检查diffusion版本

@hjj-lmx
Copy link
Author

hjj-lmx commented Apr 16, 2025

检查diffusion版本

请问一下vllm加速是否会合并到主项目中

@aluminumbox
Copy link
Collaborator

检查diffusion版本

请问一下vllm加速是否会合并到主项目中

@hjj-lmx
Copy link
Author

hjj-lmx commented Apr 16, 2025

检查diffusion版本
降低版本后又报错
Traceback (most recent call last):
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "E:\Project\UD-AI-TextToSpeech\text_to_speech\server_gpu.py", line 36, in
clone_model = CosyVoice2(os.path.join("checkpoints", "CosyVoice2-0.5B"), True, True, True, False)
File "E:\Project\UD-AI-TextToSpeech\text_to_speech\cosyvoice\cli\cosyvoice.py", line 161, in init
self.model.load_trt('{}/flow.decoder.estimator.{}.mygpu.plan'.format(model_dir, 'fp16' if self.fp16 is True else 'fp32'),
File "E:\Project\UD-AI-TextToSpeech\text_to_speech\cosyvoice\cli\model.py", line 86, in load_trt
convert_onnx_to_trt(flow_decoder_estimator_model, self.get_trt_kwargs(), flow_decoder_onnx_model, fp16)
File "E:\Project\UD-AI-TextToSpeech\text_to_speech\cosyvoice\cli\model.py", line 358, in get_trt_kwargs
assert self.use_flow_cache is True, "get_trt_kwargs is set for flow cache mode. If you want to use trt with use_flow_cache=False, please set higher max_shape"
AssertionError: get_trt_kwargs is set for flow cache mode. If you want to use trt with use_flow_cache=False, please set higher max_shape
use_flow_cache已经是False

@hjj-lmx
Copy link
Author

hjj-lmx commented Apr 16, 2025

检查diffusion版本

请问一下vllm加速是否会合并到主项目中

您大概什么时候有时间会合并到主项目

@albertosaponaro
Copy link

Try freezing diffusers==0.29.0. It worked for me.

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

3 participants