Open SirBitesalot opened 10 months ago
For error 1 and 2 that is because I didn't have a chance to run tests on CPU only, just cuda so the fact it got that far without an issue is good. Everything should work correctly if you use the gpu and not CPU only for now.
For error 2 it will work if you cast the audio array to float32
torch or numpy type.
For error 3 it will work if you paudio1.to('cpu')
or set output_device='cpu'
, that output_device is only to specify where the tensor will go, not what will run the models.
It might also be helpful to make a separate project, and use this library as a dependency instead of as a fork. There probably won't be any issues with where your service.py
file is located, but I only tested running the code in a file outside of the inferrvc
module. If you'd like the import to be easier (eg putting it in a requirements.txt) I can put it on pypi.
lmk if any of these help.
Hey thank you very much for your response casting the audio array to float32 does indeed enable me to save the result. It seems that i now have issues with mismatched sample rates as the result differ quite drastically in the expected length and pitch. Changing the Sample Rate it is saved as does not solve this. I will see if I can figure out what is happening. If I get it working on CPU i will update you.
You can have the file path as input instead of giving it the tensor and it will get the right sample rate for the original audio. If you want to give it the tensor instead do paudio1.frequency=samplerate
that will add a frequency parameter to the tensors dict, the model will read that and match sample rates correctly.
I see it’s my fault actually I didn’t have it in the documentation. After calling:
aud,sr = load_torchaudio('path/to/audio.wav')
Do
aud.frequency=sr
Then it should work. In the next update I will make that automatic in the load_torchaudio.
Updated load_torchaudio
, the sample rate mismatch should be fixed now without changing your code. Just reinstall with pip.
Hey sorry for the late reply the load_torchaudio update did indeed fix the Samplerate issue.
I can now sucessfully run the inference if I use RVC.NO_CHANGE and disable indexing. With indexing enabled I get this error:
`H:\anaconda3\envs\rvcservice\Lib\site-packages\inferrvc\pipeline.py:219: RuntimeWarning: invalid value encountered in divide
weight /= weight.sum(axis=1, keepdims=True)
Traceback (most recent call last):
File "F:\rvcservice\test.py", line 16, in
IndexError: index -1 is out of bounds for axis 0 with size 0`
Just to make sure did you check that genji.index_path is correct? I'll take a look at this thanks.
The program is not working. I tried with installed version and from source. Out of the box i get the following error:
If i change output_volume from
RVC.MATCH_ORIGINAL
toRVC.NO_CHANGE
i get:If I change the decice from cpu to cuda i get:
I use python 3.11.
Can you provide me with detailed information how this is to be used?