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

今日更新后报错'ValueError: high is out of bounds for int32' #11

Closed
alex9441 opened this issue Jun 6, 2024 · 3 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@alex9441
Copy link

alex9441 commented Jun 6, 2024

今天更新后报错,日志如下
(Chattts-ui) PS C:\0_AI_0\ChatTTS-Forge\10> python webui.py --half
device use cuda
Traceback (most recent call last):
File "C:\0_AI_0\ChatTTS-Forge\10\webui.py", line 19, in
from modules.synthesize_audio import synthesize_audio
File "C:\0_AI_0\ChatTTS-Forge\10\modules\synthesize_audio.py", line 4, in
from modules.SynthesizeSegments import SynthesizeSegments, combine_audio_segments
File "C:\0_AI_0\ChatTTS-Forge\10\modules\SynthesizeSegments.py", line 57, in
class SynthesizeSegments:
File "C:\0_AI_0\ChatTTS-Forge\10\modules\SynthesizeSegments.py", line 58, in SynthesizeSegments
batch_default_spk_seed = int(np.random.randint(0, 2**32 - 1))
File "numpy\random\mtrand.pyx", line 780, in numpy.random.mtrand.RandomState.randint
File "numpy\random\_bounded_integers.pyx", line 1423, in numpy.random._bounded_integers._rand_int32
ValueError: high is out of bounds for int32

问了Gemini,Gemini解释如下:
"您在 ChatTTS-ui 项目中遇到的 ValueError: high is out of bounds for int32 错误,源于 C:\0_AI_0\ChatTTS-Forge\10\modules\SynthesizeSegments.py 文件中的第 58 行。该代码尝试使用 np.random.randint(0, 232 - 1) 生成一个随机整数 (batch_default_spk_seed)。然而,32 位整数 (int32) 的最大可表示值为 2,147,483,647。代码试图生成一个高达 232 - 1 (即 4,294,967,295) 的数字,超出了 int32 的限制。"

我暂时修改代码如下:
batch_default_spk_seed = int(np.random.randint(0, 2**32 - 1, dtype=np.int64))

程序顺利运行.

报告一下,不提交了.

祝码运昌隆!

@alex9441
Copy link
Author

alex9441 commented Jun 6, 2024

还有个奇异现象,每次新启动,第一次生成后会报错
C:\Users……conda\envs\Chattts-ui\lib\site-packages\torch\nn\modules\conv.py:306: UserWarning: Plan failed with a cudnnException: CUDNN_BACKEND_EXECUTION_PLAN_DESCRIPTOR: cudnnFinalize Descriptor Failed cudnn_status: CUDNN_STATUS_NOT_SUPPORTED (Triggered internally at ..\aten\src\ATen\native\cudnn\Conv_v8.cpp:919.)
 return F.conv1d(input, weight, bias, self.stride,

第二次生成后这条就消失了.而且观察生成速度和GPU占用都没问题.

@zengjixiang
Copy link

我也發現這個 Bug , 直接修改 modules\SynthesizeSegments.py 第 57 行 和 58 行即可
我猜應該是 2**31 - 1

(我是用某 AI 提供的解法)
batch_default_spk_seed = int(np.random.randint(0, np.iinfo(np.int32).max))
batch_default_infer_seed = int(np.random.randint(0, np.iinfo(np.int32).max))

@zhzLuke96 zhzLuke96 self-assigned this Jun 6, 2024
@zhzLuke96 zhzLuke96 added the bug Something isn't working label Jun 6, 2024
zhzLuke96 added a commit that referenced this issue Jun 6, 2024
@zhzLuke96
Copy link
Member

fixed af06646

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

3 participants