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

Google collab script error: Audio.__init__() got an unexpected keyword argument 'source' #148

Open
proudjiao opened this issue Dec 1, 2023 · 13 comments

Comments

@proudjiao
Copy link

Running the collab block renders the following error

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
[/content/VALL-E-X/app.py](https://localhost:8080/#) in <module>
    487                                       placeholder="Write transcript here. (leave empty to use whisper)",
    488                                       value="", elem_id=f"prompt-name")
--> 489                 upload_audio_prompt = gr.Audio(label='uploaded audio prompt', source='upload', interactive=True)
    490                 record_audio_prompt = gr.Audio(label='recorded audio prompt', source='microphone', interactive=True)
    491             with gr.Column():

[/usr/local/lib/python3.10/dist-packages/gradio/component_meta.py](https://localhost:8080/#) in wrapper(*args, **kwargs)
    150             return None
    151         else:
--> 152             return fn(self, **kwargs)
    153 
    154     return wrapper

TypeError: Audio.__init__() got an unexpected keyword argument 'source'
@ccjackcong
Copy link

嗯,同样的问题,也是一筹莫展。等大佬帮助。

TypeError Traceback (most recent call last)
/content/VALL-E-X/app.py in
487 placeholder="Write transcript here. (leave empty to use whisper)",
488 value="", elem_id=f"prompt-name")
--> 489 upload_audio_prompt = gr.Audio(label='uploaded audio prompt', source='upload', interactive=True)
490 record_audio_prompt = gr.Audio(label='recorded audio prompt', source='microphone', interactive=True)
491 with gr.Column():

/usr/local/lib/python3.10/dist-packages/gradio/component_meta.py in wrapper(*args, **kwargs)
150 return None
151 else:
--> 152 return fn(self, **kwargs)
153
154 return wrapper

TypeError: Audio.init() got an unexpected keyword argument 'source'

@hkzbiyx
Copy link
Contributor

hkzbiyx commented Dec 4, 2023

#132

@ccjackcong
Copy link

#132

谢谢,尝试了几种方法,还是有错误。但是错误行数不一样了。`AttributeError Traceback (most recent call last)
/content/VALL-E-X/app.py in
333
334
--> 335 from utils.sentence_cutter import split_text_into_sentences
336 @torch.no_grad()
337 def infer_long_text(text, preset_prompt, prompt=None, language='auto', accent='no-accent'):

9 frames
/usr/local/lib/python3.10/dist-packages/numpy/init.py in getattr(attr)
309 """
310 try:
--> 311 x = ones(2, dtype=float32)
312 if not abs(x.dot(x) - float32(2.0)) < 1e-5:
313 raise AssertionError()

AttributeError: module 'numpy' has no attribute

'_no_nep50_warning'`

@hkzbiyx
Copy link
Contributor

hkzbiyx commented Dec 5, 2023

#132

谢谢,尝试了几种方法,还是有错误。但是错误行数不一样了。`AttributeError Traceback (most recent call last) /content/VALL-E-X/app.py in 333 334 --> 335 from utils.sentence_cutter import split_text_into_sentences 336 @torch.no_grad() 337 def infer_long_text(text, preset_prompt, prompt=None, language='auto', accent='no-accent'):

9 frames /usr/local/lib/python3.10/dist-packages/numpy/init.py in getattr(attr) 309 """ 310 try: --> 311 x = ones(2, dtype=float32) 312 if not abs(x.dot(x) - float32(2.0)) < 1e-5: 313 raise AssertionError()

AttributeError: module 'numpy' has no attribute

'_no_nep50_warning'`

看起来是numpy版本问题,试一下更新到最新版

pip uninstall numpy
pip install numpy

@ccjackcong
Copy link

#132

谢谢,尝试了几种方法,还是有错误。但是错误行数不一样了。`AttributeError Traceback (most recent call last) /content/VALL-E-X/app.py in 333 334 --> 335 from utils.sentence_cutter import split_text_into_sentences 336 @torch.no_grad() 337 def infer_long_text(text, preset_prompt, prompt=None, language='auto', accent='no-accent'):
9 frames /usr/local/lib/python3.10/dist-packages/numpy/init.py in getattr(attr) 309 """ 310 try: --> 311 x = ones(2, dtype=float32) 312 if not abs(x.dot(x) - float32(2.0)) < 1e-5: 313 raise AssertionError()
AttributeError: module 'numpy' has no attribute

'_no_nep50_warning'`

看起来是numpy版本问题,试一下更新到最新版

pip uninstall numpy
pip install numpy

感谢您的帮助,我回头再试试。

@ccjackcong
Copy link

#132

谢谢,尝试了几种方法,还是有错误。但是错误行数不一样了。`AttributeError Traceback (most recent call last) /content/VALL-E-X/app.py in 333 334 --> 335 from utils.sentence_cutter import split_text_into_sentences 336 @torch.no_grad() 337 def infer_long_text(text, preset_prompt, prompt=None, language='auto', accent='no-accent'):
9 frames /usr/local/lib/python3.10/dist-packages/numpy/init.py in getattr(attr) 309 """ 310 try: --> 311 x = ones(2, dtype=float32) 312 if not abs(x.dot(x) - float32(2.0)) < 1e-5: 313 raise AssertionError()
AttributeError: module 'numpy' has no attribute

'_no_nep50_warning'`

看起来是numpy版本问题,试一下更新到最新版

pip uninstall numpy
pip install numpy

刚做了尝试,又出现新的错误:
TypeError Traceback (most recent call last)
/content/VALL-E-X/VALL-E-X/VALL-E-X/app.py in
487 placeholder="Write transcript here. (leave empty to use whisper)",
488 value="", elem_id=f"prompt-name")
--> 489 upload_audio_prompt = gr.Audio(label='uploaded audio prompt', source='upload', interactive=True)
490 record_audio_prompt = gr.Audio(label='recorded audio prompt', source='microphone', interactive=True)
491 with gr.Column():

/usr/local/lib/python3.10/dist-packages/gradio/component_meta.py in wrapper(*args, **kwargs)

TypeError: Audio.init() got an unexpected keyword argument 'source'

估计是它的库跟现在的colab现有的不兼容吧。

@hkzbiyx
Copy link
Contributor

hkzbiyx commented Dec 5, 2023

@ccjackcong
试一下把gradio版本重装为3.41.2,numpy版本重装为1.24.4或许可以解决问题。在我电脑上的环境是这样的。

pip install numpy==1.24.4
pip install gradio==3.41.2

@ccjackcong
Copy link

@ccjackcong 试一下把gradio版本重装为3.41.2,numpy版本重装为1.24.4或许可以解决问题。在我电脑上的环境是这样的。

pip install numpy==1.24.4
pip install gradio==3.41.2

刚做了测试了,还是不行。因该还是依赖有冲突,但是好像很多,一时间不知道怎么下手。

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
lida 0.0.10 requires kaleido, which is not installed.
cupy-cuda11x 11.0.0 requires numpy<1.26,>=1.20, but you have numpy 1.26.2 which is incompatible.
tensorflow-probability 0.22.0 requires typing-extensions<4.6.0, but you have typing-extensions 4.8.0 which is incompatible.
torchtext 0.16.0 requires torch==2.1.0, but you have torch 2.0.1 which is incompatible.

@hkzbiyx
Copy link
Contributor

hkzbiyx commented Dec 5, 2023

刚做了测试了,还是不行。因该还是依赖有冲突,但是好像很多,一时间不知道怎么下手。

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. lida 0.0.10 requires kaleido, which is not installed. cupy-cuda11x 11.0.0 requires numpy<1.26,>=1.20, but you have numpy 1.26.2 which is incompatible. tensorflow-probability 0.22.0 requires typing-extensions<4.6.0, but you have typing-extensions 4.8.0 which is incompatible. torchtext 0.16.0 requires torch==2.1.0, but you have torch 2.0.1 which is incompatible.

我过几天重新装一下环境测试一下吧,这几天比较忙,没啥空闲时间慢慢解决依赖冲突

@hkzbiyx
Copy link
Contributor

hkzbiyx commented Dec 5, 2023

@ccjackcong 试一下把gradio版本重装为3.41.2,numpy版本重装为1.24.4或许可以解决问题。在我电脑上的环境是这样的。

pip install numpy==1.24.4
pip install gradio==3.41.2

先谢谢您,我找时间跑一遍再。另外,想请教您,mac下,有能训练的模型吗?我想试试本地,但我win电脑的显卡不行,所以像试试mac下。

就我所知应该没单独给mac的模型,我不太清楚这一块,你可以试试转译啥的能不能用。你win的显卡如果有6gb的显存应该就可以用了。如果显存不够应该可以换个小的whisper模型用,不过比较折腾,得新下个模型,然后修改对应加载的代码。理论上单语音生成的部分应该对显卡要求不高,不过我不是写核心部分的,不太清楚对显卡要求有多低。

@ccjackcong
Copy link

我不是写核心部

感谢您的回复。我现在就打算在colab上做训练,回头在本地推理了。我win电脑显卡不行,只能推理,达不到训练要求。再次感谢。

@hkzbiyx
Copy link
Contributor

hkzbiyx commented Jan 13, 2024

@ccjackcong 试一下把gradio版本重装为3.41.2,numpy版本重装为1.24.4或许可以解决问题。在我电脑上的环境是这样的。

pip install numpy==1.24.4
pip install gradio==3.41.2

刚做了测试了,还是不行。因该还是依赖有冲突,但是好像很多,一时间不知道怎么下手。

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. lida 0.0.10 requires kaleido, which is not installed. cupy-cuda11x 11.0.0 requires numpy<1.26,>=1.20, but you have numpy 1.26.2 which is incompatible. tensorflow-probability 0.22.0 requires typing-extensions<4.6.0, but you have typing-extensions 4.8.0 which is incompatible. torchtext 0.16.0 requires torch==2.1.0, but you have torch 2.0.1 which is incompatible.

@ccjackcong
之前太忙了,现在才有时间测试环境,抱歉。我从requirements.txt新装的没发现问题,应该是可以直接跑的。根据报错来看,你的cuda版本太低了,要更新一下版本,CUDA 版本在11.7 ~ 12.0才能正常运行。你的环境可能还得重装一下lida包(这个项目并没有用到这个依赖),更新一下torch相关的包。

@ccjackcong
Copy link

@hkzbiyx 感谢回复啦,这个我慢慢研究,最近在学习使用bert-vits2那个模型训练呢。

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