Skip to content

Commit

Permalink
RMVPE:
Browse files Browse the repository at this point in the history
different device bug, not finding root caused yet.
  • Loading branch information
w-okada committed Jul 26, 2023
1 parent f96b4c2 commit 9de7428
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
import numpy as np
from librosa.filters import mel

from mods.log_control import VoiceChangaerLogger

logger = VoiceChangaerLogger.get_instance().getLogger()


class BiGRU(nn.Module):
def __init__(self, input_features, hidden_features, num_layers):
Expand Down Expand Up @@ -318,6 +322,9 @@ def forward(self, audio, keyshift=0, speed=1, center=True):
if resize < size:
magnitude = F.pad(magnitude, (0, 0, 0, size - resize))
magnitude = magnitude[:, :size, :] * self.win_length / win_length_new
if self.mel_basis.device != magnitude.device:
logger.warn(f"[RMVPE] Device is not same. mel_basis:{self.mel_basis.device}, magnitude:{magnitude.device}")
self.mel_basis.to(magnitude.device)
mel_output = torch.matmul(self.mel_basis, magnitude)
if self.is_half is True:
mel_output = mel_output.half()
Expand Down

0 comments on commit 9de7428

Please sign in to comment.