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

how to use Cuda for mfcc feat processing #265

Open
pawel-rozwoda opened this issue Apr 24, 2021 · 0 comments
Open

how to use Cuda for mfcc feat processing #265

pawel-rozwoda opened this issue Apr 24, 2021 · 0 comments

Comments

@pawel-rozwoda
Copy link

Is any possibilty to generate feats like mfcc using Cuda in pyKaldi ?

Here is some snippet

logmel_opts = FbankOptions()
logmel_opts.frame_opts.samp_freq = SAMPLERATE
"""N_FILTERS = 40"""
logmel_opts.mel_opts.num_bins = LOG_MEL_FILTERS
fbank = Fbank(logmel_opts)

sf = logmel_opts.frame_opts.samp_freq
channel = Vector(signal)
cuda_vector = CuVector.from_vector(channel)
feats = fbank.compute_features(cuda_vector, sf, 1.0)

code above generate error like this:

Traceback (most recent call last):
  File "vox_generate.py", line 53, in <module>
    feats_0 = torch.Tensor(logmel_feats(signal=ch_0_filtered))
  File "/home/prozwoda/diarization/src/kaldi_feats.py", line 29, in logmel_feats
    feats = fbank.compute_features(cuda_vector, sf, 1.0)
TypeError: compute_features() argument wave is not valid for ::kaldi::VectorBase<float> (kaldi.cudamatrix._cu_vector.CuVector instance given): expecting kaldi.matrix._kaldi_vector.VectorBase instance, got kaldi.cudamatrix._cu_vector.CuVector instance

When I pass channel which is of type Vector into compute_features everything work fine, but on CPU.

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