[GH-ISSUE #1469] Possible issue with model output resampling #952

Closed
opened 2026-10-20 10:04:32 +00:00 by bsakaguchi · 3 comments
Owner

Originally created by @ThePhosphorus on GitHub (Oct 24, 2023).
Original GitHub issue: https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/issues/1469

Hello,

let me start by saying great job on the work you did here.
I've been working on making your model compatible with torchscript, but I am confused about specific lines of code.

mainly in infer/modules/vc/pipeline.py:445, modules.py:211 and infer/modules/vc/modules.py:211

if tgt_sr != resample_sr >= 16000:
    # Exemple Code
    audio_opt = librosa.resample(
                audio_opt, orig_sr=tgt_sr, target_sr=resample_sr
            )

It does not seem to do what it is intended to do (it compares tgt_sr != resample_sr then compares the boolean to 16000.

Originally created by @ThePhosphorus on GitHub (Oct 24, 2023). Original GitHub issue: https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/issues/1469 Hello, let me start by saying great job on the work you did here. I've been working on making your model compatible with torchscript, but I am confused about specific lines of code. mainly in `infer/modules/vc/pipeline.py:445`, `modules.py:211` and `infer/modules/vc/modules.py:211` ```python if tgt_sr != resample_sr >= 16000: # Exemple Code audio_opt = librosa.resample( audio_opt, orig_sr=tgt_sr, target_sr=resample_sr ) ``` It does not seem to do what it is intended to do (it compares `tgt_sr != resample_sr` then compares the boolean to `16000`.
Author
Owner

@houyafei commented on GitHub (Apr 17, 2024):

tgt_sr != resample_sr >= 16000 应该是等价于
tgt_sr != resample_sr and resample_sr >= 16000

<!-- gh-comment-id:2060825849 --> @houyafei commented on GitHub (Apr 17, 2024): tgt_sr != resample_sr >= 16000 应该是等价于 tgt_sr != resample_sr and resample_sr >= 16000
Author
Owner

@houyafei commented on GitHub (Apr 17, 2024):

你是怎么把模型转换为torchScript,就是这个项目中使用到的模型,还有自己训练出来的模型。
可以加一下联系方式吗 yafeihou@sina.com是我的邮件

<!-- gh-comment-id:2060830524 --> @houyafei commented on GitHub (Apr 17, 2024): 你是怎么把模型转换为torchScript,就是这个项目中使用到的模型,还有自己训练出来的模型。 可以加一下联系方式吗 yafeihou@sina.com是我的邮件
Author
Owner

@ThePhosphorus commented on GitHub (Apr 19, 2024):

Hi. In order to convert the model to Torchscript. I wre-wrote all components that did not work with Torchscript. then, I imported the weights from the given models and transferred them to the new nn modules.

While I was successful in converting some parts of the model in Torchscript. I dropped the project when I had to convert the f0 extraction to Torchscript.

<!-- gh-comment-id:2065555290 --> @ThePhosphorus commented on GitHub (Apr 19, 2024): Hi. In order to convert the model to Torchscript. I wre-wrote all components that did not work with Torchscript. then, I imported the weights from the given models and transferred them to the new nn modules. While I was successful in converting some parts of the model in Torchscript. I dropped the project when I had to convert the f0 extraction to Torchscript.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
RVC-Project/Retrieval-based-Voice-Conversion-WebUI#952
No description provided.