effusiveperiscope / so-vits-svc

so-vits-svc
MIT License
179 stars 72 forks source link

issue with inferring on rmvpe #48

Open tomas122727 opened 6 months ago

tomas122727 commented 6 months ago

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 commented 1 month ago

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