Code Monkey home page Code Monkey logo

Comments (42)

v3ucn avatar v3ucn commented on August 17, 2024 1
if __name__ == '__main__':

    # 阻止子进程重启
    import multiprocessing
    multiprocessing.freeze_support()
    # ------------------------------------

    # 封装前运行
    uvicorn.run(app="api_v2:app", host="0.0.0.0", port=12233, workers=5)

from gpt-sovits.

XXXXRT666 avatar XXXXRT666 commented on August 17, 2024 1

检查代码,看看import的是哪里的CNHubert,你import的可能是Main分支

from gpt-sovits.

lckj2009 avatar lckj2009 commented on August 17, 2024

请问,api_v2.py在哪里?没找到这个文件

from gpt-sovits.

v3ucn avatar v3ucn commented on August 17, 2024

请问,api_v2.py在哪里?没找到这个文件

在 fast_inference_分支

from gpt-sovits.

ctrlcplusv avatar ctrlcplusv commented on August 17, 2024
if __name__ == '__main__':

    # 阻止子进程重启
    import multiprocessing
    multiprocessing.freeze_support()
    # ------------------------------------

    # 封装前运行
    uvicorn.run(app="api_v2:app", host="0.0.0.0", port=12233, workers=5)

还是有问题,报错这个
Snipaste_2024-06-13_18-31-00

from gpt-sovits.

lckj2009 avatar lckj2009 commented on August 17, 2024

请问,api_v2.py在哪里?没找到这个文件

在 fast_inference_分支

你好,fast_inference_分支在哪里呀,GPT-SoVITS目录里面没找到

from gpt-sovits.

Separatee avatar Separatee commented on August 17, 2024

请问,api_v2.py在哪里?没找到这个文件

在 fast_inference_分支

你好,fast_inference_分支在哪里呀,GPT-SoVITS目录里面没找到

@lckj2009 第一次用github吗?在仓库界面,从main切换到fast_inference_
Here

如果你想从当前的main版本切换到fast_inference_分支,只需要使用git,额外加上-b参数,即 -b fast_inference_。命令如下

git clone --depth=1 https://github.com/RVC-Boss/GPT-SoVITS.git -b fast_inference_

或者直接在切换后的分支界面点下载zip压缩包也可以。
把新下载的分支全部覆盖你的原文件
之后只需要额外的安装wordsegments包就能从main切换到fast_inference_了

/path/to/your/python -m pip install wordsegments

from gpt-sovits.

wx971025 avatar wx971025 commented on August 17, 2024
if __name__ == '__main__':

    # 阻止子进程重启
    import multiprocessing
    multiprocessing.freeze_support()
    # ------------------------------------

    # 封装前运行
    uvicorn.run(app="api_v2:app", host="0.0.0.0", port=12233, workers=5)

还是有问题,报错这个 Snipaste_2024-06-13_18-31-00

我遇到了相同的问题,当uvicorn==0.21.0时可以正常启动

from gpt-sovits.

lckj2009 avatar lckj2009 commented on August 17, 2024

uvicorn

多谢,但是我尝试在 conda环境下运行 python api_v2.py。结果报错了,如下:

(GPT-SoVITS) E:\GPT-SoVITS>python api_v2.py
Loading Text2Semantic weights from GPT_weights/lvbu-e30.ckpt
Loading VITS weights from GPT_SoVITS/pretrained_models/s2G488k.pth
C:\Users\ww\anaconda3\envs\GPT-SoVITS\lib\site-packages\torch\nn\utils\weight_norm.py:30: UserWarning: torch.nn.utils.weight_norm is deprecated in favor of torch.nn.utils.parametrizations.weight_norm.
warnings.warn("torch.nn.utils.weight_norm is deprecated in favor of torch.nn.utils.parametrizations.weight_norm.")
Loading BERT weights from GPT_SoVITS/pretrained_models/chinese-roberta-wwm-ext-large
C:\Users\ww\anaconda3\envs\GPT-SoVITS\lib\site-packages\torch_utils.py:831: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly. To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()
return self.fget.get(instance, owner)()
Loading CNHuBERT weights from GPT_SoVITS/pretrained_models/chinese-hubert-base
Traceback (most recent call last):
File "E:\GPT-SoVITS\api_v2.py", line 143, in
tts_pipeline = TTS(tts_config)
File "E:\GPT-SoVITS\GPT_SoVITS\TTS_infer_pack\TTS.py", line 205, in init
self._init_models()
File "E:\GPT-SoVITS\GPT_SoVITS\TTS_infer_pack\TTS.py", line 232, in _init_models
self.init_cnhuhbert_weights(self.configs.cnhuhbert_base_path)
File "E:\GPT-SoVITS\GPT_SoVITS\TTS_infer_pack\TTS.py", line 239, in init_cnhuhbert_weights
self.cnhuhbert_model = CNHubert(base_path)
TypeError: CNHubert.init() takes 1 positional argument but 2 were given

from gpt-sovits.

lckj2009 avatar lckj2009 commented on August 17, 2024

检查代码,看看import的是哪里的CNHubert,你import的可能是Main分支

我clone的应该是Main分支。 api_v2.py和V3主要特点是什么,我还不明白。是不是现在流行用 fast_inference_ 分支的api_v2.py、v3?

from gpt-sovits.

XXXXRT666 avatar XXXXRT666 commented on August 17, 2024

我clone的应该是Main分支。 api_v2.py和V3主要特点是什么,我还不明白。是不是现在流行用 fast_inference_ 分支的api_v2.py、v3?

去看看cnhubert.__file__

from gpt-sovits.

lckj2009 avatar lckj2009 commented on August 17, 2024

我clone的应该是Main分支。 api_v2.py和V3主要特点是什么,我还不明白。是不是现在流行用 fast_inference_ 分支的api_v2.py、v3?

去看看cnhubert.__path__

TTS.py 的一部分引用

from AR.models.t2s_lightning_module import Text2SemanticLightningModule
from feature_extractor.cnhubert import CNHubert
from module.models import SynthesizerTrn
import librosa
from time import time as ttime
from tools.i18n.i18n import I18nAuto
from my_utils import load_audio
from module.mel_processing import spectrogram_torch
from TTS_infer_pack.text_segmentation_method import splits
from TTS_infer_pack.TextPreprocessor import TextPreprocessor
i18n = I18nAuto()

from gpt-sovits.

lckj2009 avatar lckj2009 commented on August 17, 2024

(GPT-SoVITS) E:\bak>git clone https://github.com/RVC-Boss/GPT-SoVITS.git
Cloning into 'GPT-SoVITS'...
error: RPC failed; curl 28 Recv failure: Connection was reset
fatal: expected flush after ref listing

fast_inference_ 分支clone一直失败

from gpt-sovits.

wx971025 avatar wx971025 commented on August 17, 2024

(GPT-SoVITS) E:\bak>git clone https://github.com/RVC-Boss/GPT-SoVITS.git Cloning into 'GPT-SoVITS'... error: RPC failed; curl 28 Recv failure: Connection was reset fatal: expected flush after ref listing

fast_inference_ 分支clone一直失败

首先 clone特定分支要加-b参数,其次 你可以直接download一个项目的zip 解压使用

from gpt-sovits.

XXXXRT666 avatar XXXXRT666 commented on August 17, 2024

TTS.py 的一部分引用

import之后让他print一下看看__path__

from gpt-sovits.

lckj2009 avatar lckj2009 commented on August 17, 2024

测试代码:
from feature_extractor.cnhubert import CNHubert

print(CNHubert. _ _ path _ _)

运行结果:

已连接到 pydev 调试器(内部版本号 222.4554.11)Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm 2022.2.5\plugins\python\helpers\pydev\pydevd.py", line 1496, in exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "C:\Program Files\JetBrains\PyCharm 2022.2.5\plugins\python\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "E:\GPT-SoVITS-fast_inference\ceshi.py", line 3, in
print(CNHubert.path)
AttributeError: type object 'CNHubert' has no attribute 'path'. Did you mean: 'hash'?
python-BaseException

from gpt-sovits.

XXXXRT666 avatar XXXXRT666 commented on August 17, 2024

记错了,是__file__

from gpt-sovits.

lckj2009 avatar lckj2009 commented on August 17, 2024

已连接到 pydev 调试器(内部版本号 222.4554.11)Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm 2022.2.5\plugins\python\helpers\pydev\pydevd.py", line 1496, in exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "C:\Program Files\JetBrains\PyCharm 2022.2.5\plugins\python\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "E:\GPT-SoVITS-fast_inference
\ceshi.py", line 3, in
print(CNHubert.file)
AttributeError: type object 'CNHubert' has no attribute ' _ _file _ _'. Did you mean: ' _ _ le _ _'?

from gpt-sovits.

XXXXRT666 avatar XXXXRT666 commented on August 17, 2024

去看看cnhubert.__file__

cnhubert和CNHubert是两个东西,而且需要知道的是报错前一刻他import的是哪个模块,而不是一个测试,直接在报错前from feature_extractor import cnhubert看看 cnhubert.__file__

from gpt-sovits.

Separatee avatar Separatee commented on August 17, 2024

看了你启动失败的问题
尝试使用这个Windows版本(不要滥用下载链接):
0306fix

还有你克隆的方式不对,既然你当初git clone没有加参数,那么git默认把所有分支和commit都克隆了,请阅读git基本教程了解git的使用原理。请使用

git branch _fast_inference
git pull -f

切换到_fast_inference分支。
如果还是不行 尝试:

git remote remove origin && git remote add origin https://github.xn--z0s.top/rvc-boss/gpt-sovits

使用我的github镜像网站进行git pull -f

from gpt-sovits.

lckj2009 avatar lckj2009 commented on August 17, 2024

去看看cnhubert.__file__

cnhubert和CNHubert是两个东西,而且需要知道的是报错前一刻他import的是哪个模块,而不是一个测试,直接在报错前from feature_extractor import cnhubert看看 cnhubert.__file__

cuowu

feature_extractor.cnhubert 里面只有 CNHubert,没有 cnhubert

from gpt-sovits.

lckj2009 avatar lckj2009 commented on August 17, 2024

看了你启动失败的问题 尝试使用这个Windows版本(不要滥用下载链接): 0306fix

还有你克隆的方式不对,既然你当初git clone没有加参数,那么git默认把所有分支和commit都克隆了,请阅读git基本教程了解git的使用原理。请使用

git branch _fast_inference
git pull -f

切换到_fast_inference分支。 如果还是不行 尝试:

git remote remove origin && git remote add origin https://github.xn--z0s.top/rvc-boss/gpt-sovits

使用我的github镜像网站进行git pull -f

连接下载不了,网速0。我尝试 git branch _fast_inference 看看

from gpt-sovits.

Separatee avatar Separatee commented on August 17, 2024

看了你启动失败的问题 尝试使用这个Windows版本(不要滥用下载链接): 0306fix
还有你克隆的方式不对,既然你当初git clone没有加参数,那么git默认把所有分支和commit都克隆了,请阅读git基本教程了解git的使用原理。请使用

git branch _fast_inference
git pull -f

切换到_fast_inference分支。 如果还是不行 尝试:

git remote remove origin && git remote add origin https://github.xn--z0s.top/rvc-boss/gpt-sovits

使用我的github镜像网站进行git pull -f

连接下载不了,网速0。我尝试 git branch _fast_inference 看看

使用
git remote -v查看一下当前的远程服务器地址是否有误,实际上你只需要把前缀域名改一下,从github.com转为github.xn--z0s.top
还有你还可以试一下我最开始说的0306fix版本的下载链接(蓝色字体)

from gpt-sovits.

Separatee avatar Separatee commented on August 17, 2024

看了你启动失败的问题 尝试使用这个Windows版本(不要滥用下载链接): 0306fix
还有你克隆的方式不对,既然你当初git clone没有加参数,那么git默认把所有分支和commit都克隆了,请阅读git基本教程了解git的使用原理。请使用

git branch _fast_inference
git pull -f

切换到_fast_inference分支。 如果还是不行 尝试:

git remote remove origin && git remote add origin https://github.xn--z0s.top/rvc-boss/gpt-sovits

使用我的github镜像网站进行git pull -f

连接下载不了,网速0。我尝试 git branch _fast_inference 看看

抱歉 我的说法有误,你应该在地址末尾加上.git

git remote add origin https://github.xn--z0s.top/rvc-boss/gpt-sovits.git

而不是

git remote add origin https://github.xn--z0s.top/rvc-boss/gpt-sovits

from gpt-sovits.

lckj2009 avatar lckj2009 commented on August 17, 2024

0306fix版本的下载链接

0306fix版本的下载链接,网速0。

from gpt-sovits.

lckj2009 avatar lckj2009 commented on August 17, 2024

33

from gpt-sovits.

Separatee avatar Separatee commented on August 17, 2024

0306fix版本的下载链接

0306fix版本的下载链接,网速0。

检查一下你是不是开魔法了 这是阿里云北京的CDN节点

from gpt-sovits.

Separatee avatar Separatee commented on August 17, 2024

33

在你原来的文件夹里用这个命令

from gpt-sovits.

lckj2009 avatar lckj2009 commented on August 17, 2024

0306fix版本的下载链接

0306fix版本的下载链接,网速0。

检查一下你是不是开魔法了 这是阿里云北京的CDN节点

没有,迅雷下不了。360浏览器也是

from gpt-sovits.

XXXXRT666 avatar XXXXRT666 commented on August 17, 2024

去看看cnhubert.__file__

cnhubert和CNHubert是两个东西,而且需要知道的是报错前一刻他import的是哪个模块,而不是一个测试,直接在报错前from feature_extractor import cnhubert看看 cnhubert.__file__

feature_extractor.cnhubert 里面只有 CNHubert,没有 cnhubert

我说的就是cuhubert这个文件,就在你的TTS.py对应报错位置前加上,或者是你自己检查sys.path,两个分支共用环境可能导致import错误

from feature_extractor import cnhubert
print(cnhubert.__file__)

shell执行
python -c "import sys;print(sys.path)"

from gpt-sovits.

Separatee avatar Separatee commented on August 17, 2024

0306fix版本的下载链接

0306fix版本的下载链接,网速0。

检查一下你是不是开魔法了 这是阿里云北京的CDN节点

没有,迅雷下不了。360浏览器也是

…恕我直言,谁家下载用迅雷,换个Edge浏览器试试。

from gpt-sovits.

lckj2009 avatar lckj2009 commented on August 17, 2024

去看看cnhubert.__file__

cnhubert和CNHubert是两个东西,而且需要知道的是报错前一刻他import的是哪个模块,而不是一个测试,直接在报错前from feature_extractor import cnhubert看看 cnhubert.__file__

feature_extractor.cnhubert 里面只有 CNHubert,没有 cnhubert

我说的就是cuhubert这个文件,就在你的TTS.py对应报错位置前加上,或者是你自己检查sys.path,两个分支共用环境可能导致import错误

from feature_extractor import cnhubert
print(cnhubert.__file__)

shell执行 python -c "import sys;print(sys.path)"

E:\GPT-SoVITS\GPT_SoVITS\feature_extractor\cnhubert.py 准确的找到了文件地址。

from gpt-sovits.

XXXXRT666 avatar XXXXRT666 commented on August 17, 2024

E:\GPT-SoVITS\GPT_SoVITS\feature_extractor\cnhubert.py 准确的找到了文件地址。

看上下文的话,你调用的TTS.py在GPT-SoVITS-fast_infernence_里面

from gpt-sovits.

lckj2009 avatar lckj2009 commented on August 17, 2024

0306fix版本的下载链接

0306fix版本的下载链接,网速0。

检查一下你是不是开魔法了 这是阿里云北京的CDN节点

没有,迅雷下不了。360浏览器也是

…恕我直言,谁家下载用迅雷,换个Edge浏览器试试。

1

from gpt-sovits.

XXXXRT666 avatar XXXXRT666 commented on August 17, 2024

看上下文的话,你调用的TTS.py在GPT-SoVITS-fast_infernence_里面

你是不是本地还有一个Main分支,和fast inference分支属于同时存在而不是git切换的状态

from gpt-sovits.

lckj2009 avatar lckj2009 commented on August 17, 2024

看上下文的话,你调用的TTS.py在GPT-SoVITS-fast_infernence_里面

你是不是本地还有一个Main分支,和fast inference分支属于同时存在而不是git切换的状态

是这样的,刚才,我在 E:\GPT-SoVITS-fast_inference_ 文件夹里新建了一个ceshi.py。代码只有:
from feature_extractor import cnhubert
print(cnhubert.file)
这2行,运行时打印了:E:\GPT-SoVITS\GPT_SoVITS\feature_extractor\cnhubert.py
E:\GPT-SoVITS和E:\GPT-SoVITS-fast_inference_ 是2个文件夹。我估计是git版本把他们联系在一起的原因。

from gpt-sovits.

XXXXRT666 avatar XXXXRT666 commented on August 17, 2024

跟git没关系,建议分开建环境,或者去site-packages底下把users.pth清空

from gpt-sovits.

lckj2009 avatar lckj2009 commented on August 17, 2024

我还没测试在这种情况下,api_v2.py 能否运行。那么我可以测试一下?

命令就是 python api_v2.py ?无需其他参数?

from gpt-sovits.

XXXXRT666 avatar XXXXRT666 commented on August 17, 2024

users.pth只是为了更改sys.path的内容

from gpt-sovits.

Separatee avatar Separatee commented on August 17, 2024

我还没测试在这种情况下,api_v2.py 能否运行。那么我可以测试一下?

命令就是 python api_v2.py ?无需其他参数?

你可以回炉重造 在你的E盘根目录新建一个文件夹 仓库主页的Readme有0306fix的压缩包 下载下来然后把你的_fast_inference内部所有文件拖到解压后的文件夹内(覆盖并确认)
它可能会提示缺少wordsegments包那就在以当前目录打开CMD,输入.\runtime\python -m pip install wordsegments

from gpt-sovits.

Separatee avatar Separatee commented on August 17, 2024

@lckj2009 我的域名是纯ipv6,无法访问,下载速度为0的情况应该是你的路由不支持IPV6。但问题不大。

from gpt-sovits.

lckj2009 avatar lckj2009 commented on August 17, 2024

@lckj2009 我的域名是纯ipv6,无法访问,下载速度为0的情况应该是你的路由不支持IPV6。但问题不大。

我用同事的电脑下载成功了

from gpt-sovits.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.