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

issue with inferring on rmvpe #48

Open
tomas122727 opened this issue May 21, 2024 · 1 comment
Open

issue with inferring on rmvpe #48

tomas122727 opened this issue May 21, 2024 · 1 comment

Comments

@tomas122727
Copy link

AttributeError: 'InferTool' object has no attribute 'rmvpe'
ppg time: 0.8086283206939697
Traceback (most recent call last):
File "M:\so-vits-svc-5.0-main\inference_gui.py", line 1149, in convert
out_audio = self.infer_tool.infer(
File "M:\so-vits-svc-5.0-main\inference_util.py", line 325, in infer
pit = self.compute_f0_rmvpe(audio_data)
File "M:\so-vits-svc-5.0-main\inference_util.py", line 267, in compute_f0_rmvpe
f0 = self.rmvpe.infer_from_audio(audio, thred=0.03)
AttributeError: 'InferTool' object has no attribute 'rmvpe'

chat gpt told me this
The error message you're encountering indicates that the InferTool object does not have an attribute named rmvpe. This typically means that the rmvpe attribute (likely an instance of another class or a function) was not properly initialized or defined in your code.

Here are a few steps to troubleshoot and potentially resolve this issue:

Check Initialization of rmvpe:
Ensure that rmvpe is correctly initialized in the InferTool class. Typically, this might be done in the init method of the class. It should look something like this:

python
Copy code
class InferTool:
def init(self, rmvpe):
self.rmvpe = rmvpe
If rmvpe is not initialized in this manner, you need to add this initialization.

Ensure Correct Import and Definition:
Ensure that rmvpe is correctly imported and defined. If rmvpe is a class or function from another module, make sure it is imported at the beginning of your script:

python
Copy code
from some_module import RMVPE
And then, properly initialize it in the InferTool class.

Verify Attribute Assignment:
If rmvpe is supposed to be assigned dynamically, ensure that this assignment happens before any method that uses rmvpe is called. For example:

python
Copy code
self.infer_tool.rmvpe = RMVPE()
Check the Full Traceback:
Review the full traceback and the relevant code around the line numbers mentioned in the error message to understand where the initialization might be missing.

Here is an example modification of the InferTool class to ensure rmvpe is initialized properly:

python
Copy code
class InferTool:
def init(self, rmvpe=None):
if rmvpe is None:
self.rmvpe = RMVPE() # or however you initialize it
else:
self.rmvpe = rmvpe

def compute_f0_rmvpe(self, audio):
    f0 = self.rmvpe.infer_from_audio(audio, thred=0.03)
    return f0

def infer(self, audio_data):
    pit = self.compute_f0_rmvpe(audio_data)
    # other inference steps...
    return pit  # or other output

Make sure to replace RMVPE with the actual class or method you intend to use for rmvpe.

By ensuring proper initialization and assignment of rmvpe, you should be able to resolve the AttributeError and proceed with your inference.

@tomas122727
Copy link
Author

AttributeError: 'InferTool' object has no attribute 'rmvpe' please fix this issue

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

1 participant