idiap / pkwrap

A pytorch wrapper for LF-MMI training and parallel training in Kaldi
Other
73 stars 12 forks source link

write matrix error #6

Closed jasonyong closed 3 years ago

jasonyong commented 3 years ago

hi, seems there exists an error in write matrix, when I run tests/test-write-matrix.py, it gives me such error:

Traceback (most recent call last): File "test-write-matrix.py", line 12, in writer.Write("test", pkwrap.kaldi.matrix.TensorToKaldiMatrix(x)) TypeError: Write(): incompatible function arguments. The following argument types are supported:

  1. (self: _pkwrap.kaldi.matrix.BaseFloatMatrixWriter, arg0: str, arg1: kaldi::MatrixBase) -> None

Invoked with: <_pkwrap.kaldi.matrix.BaseFloatMatrixWriter object at 0x7f56c4ce71f0>, 'test', <_pkwrap.kaldi.matrix.Matrix object at 0x7f56c4ce7308>

Can you figure out what happend?

mrsrikanth commented 3 years ago

Hi,

Can you which pytorch and kaldi versions you are using? Are also compiling kaldi with MKL?

jasonyong commented 3 years ago

pytorch1.6+cuda9.2 kaldi version is d79c896 Compile kaldi with ATLAS

mrsrikanth commented 3 years ago

You have to use kaldi version 6f329a62. Usually, this problem arises in version later than the version given in README.

karaf commented 3 years ago

Hi, the kaldi version 6f329a62 unfortunately do not support cuda 11.2. and latest Kaldi fail with the error above. Is there any other option to compile pkwrap with cuda 11.2

mrsrikanth commented 3 years ago

Hello,

While I don't have the resources to test compilation with cuda 11.2, I can perhaps try compatibility with the latest Kaldi that supports 11.2. I created a new issue to follow-up: #9

karaf commented 3 years ago

Great, thanks, I will let you know if it works

mrsrikanth commented 3 years ago

I patched pwkrap (it turned out to be pretty simple change) to be compatible with recent Kaldi version. This error should not appear from again.

It was mainly because at some point BaseFloatMatrixWriter was changed to use MatrixBase (from Matrix), which pybind11 doesn't seem to like. At the moment, I have created a local typedef to undo this patch.

This error should no longer appear.