Giter Site home page Giter Site logo

Comments (8)

KarelVesely84 avatar KarelVesely84 commented on June 25, 2024

Hi Quentin,
yes, getting kaldi tools to $PATH is necessary, so that they can be used in the 'pipeline filenames':
kaldi_io.read_mat('sum-matrix ... | scale-matrix ... - |')

And, yes, i could eventually put it into a try block, and show an annoying warning if Kaldi is not found...
So you don't use kaldi at all, you are just importing the its data formats in another project?
Am i correct?
K.

from kaldi-io-for-python.

KarelVesely84 avatar KarelVesely84 commented on June 25, 2024

In what way was it failing to you? Do you use Linux, or other OS?
K.

from kaldi-io-for-python.

KarelVesely84 avatar KarelVesely84 commented on June 25, 2024

I modified it a bit, please let me know if it solves you problem:
d6f9d9f

from kaldi-io-for-python.

qmeeus avatar qmeeus commented on June 25, 2024

So you don't use kaldi at all, you are just importing the its data formats in another project?
Am i correct?

I have already computed all the features I needed with Kaldi scripts, I am indeed just using your code for loading the generated files

In what way was it failing to you? Do you use Linux, or other OS?

This section in particular is problematic:

if not 'KALDI_ROOT' in os.environ:
    # Default! To change run python with 'export KALDI_ROOT=/some_dir python'
    os.environ['KALDI_ROOT']='/mnt/matylda5/iveselyk/Tools/kaldi-trunk'

I had some problems with the encodings and was trying to traceback what was going wrong. At some point, I echo'ed my environment and saw a lot of weird things had been added to my $PATH, including a folder that did not exist in my filesystem... Turns out the code above was the reason.

I think that instead of adding this to the environment variable, which will only work for you, you should raise an error. In fact, setting $KALDI_ROOT and having Kaldi bins in the $PATH is not always necessary to use most functions in your script, so it's probably best to check and raise when Kaldi is necessary and ignore otherwise.

from kaldi-io-for-python.

KarelVesely84 avatar KarelVesely84 commented on June 25, 2024

i don't understand, how extending $PATH can cause problems with encodings... even if there is a path added that does not exist, it should not cause any failures IMHO...

and having the $PATH extended only sometimes would not be user friendly... having kaldi binaries on $PATH is an important and very handy/powerful feature...

from kaldi-io-for-python.

qmeeus avatar qmeeus commented on June 25, 2024

It does not cause problems with the encoding

from kaldi-io-for-python.

erip avatar erip commented on June 25, 2024

I'll add that it's a bit weird to include a hardcoded path that will almost certainly not exist for anyone else. If $KALDI_ROOT is really required but it's not set, it's better to throw an error than to silently set it to a path that won't necessarily exist.

from kaldi-io-for-python.

KarelVesely84 avatar KarelVesely84 commented on June 25, 2024

Well, it depends. For some use-cases running kaldi binaries in pipe commands is not necessary.
In this case setting $KALDI_ROOT is not necessary. Only in the "advanced" cases with pipes it becomes necessary.
So both "modes" make sense, depending on the circumstances...
K.

from kaldi-io-for-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.