Menu

error in MMIE lattice pruning

Help
Jake
2010-11-30
2012-09-22
  • Jake

    Jake - 2010-11-30

    I got a "failed to run" message when I run MMIE training in step
    61.lattice_pruning. The demo is RM1, step 60.lattice_generation generates
    "num" and "denum" lattices well. The program stopped immediately in phase 2
    "Posterior probability lattice pruning ..."

    The files in logdir shows as follows:

    Traceback (most recent call last):
    File "/speech/tools/asr/cmu_sphinx/rm1/python/cmusphinx/lattice_prune.py",
    line 5, in ?
    import lattice
    File "/speech/tools/asr/cmu_sphinx/rm1/python/cmusphinx/lattice.py", line 18,
    in ?
    import sphinxbase
    ImportError: No module named sphinxbase
    Tue Nov 30 17:35:49 2010

    Could anyone know how to fix it? Thanks a lot.

     
  • Nickolay V. Shmyrev

    Hello.

    It fails to find python module sphinxbase. This module is compiled with
    sphinxbase package if python support is found/enabled. This module is located
    in a single so file sphinxbase.so.

    You either need to place the file into the location where python will find it
    and load (/usr/lib/python<version>/site-packages) or adjust PYTHONPATH to
    point to the location of this file. Or you can just place this file into
    python subfolder in your training folder. </version>

     
  • Pranav Jawale

    Pranav Jawale - 2011-07-15

    Hello,

    I too have same problem. I copied sphinxbase/lib/libsphinxbase.so to
    /usr/lib/python2.6/

    Then when I type "import lattice" in Python shell I get ImportError: No module
    named sphinxbase

    When I do import libsphinxbase then error is ImportError: dynamic module does
    not define init function (initlibsphinxbase)

    Any help?
    Thanks

     
  • Jake

    Jake - 2011-07-15

    Try copying it to /usr/lib/python2.6/site-packages, which is one more
    directory deeper.

     
  • Pranav Jawale

    Pranav Jawale - 2011-07-15

    Hi,

    Thanks for the advice; but same error!

    I checked with sys.path, the *.so file is there in the path.

    Problem is that python is able to find the libsphinxbase.so file, but some
    other error is occurring ..

    ImportError: dynamic module does not define init function (initlibsphinxbase)
    

    If I delete the libsphinxbase.so file (it's actually a symlink) from
    PYTHONPATH another error occurs which says "No module named libsphinxbase"

    Did you do the same thing to solve your problem (cp
    /sphinxbase/lib/libsphinxbase.so /path/to/python/lib/files/)?

     
  • Jake

    Jake - 2011-07-15

    I didn't copy. I exported LD_LIBRARY_PATH=/path/to/sphinxbase/lib and
    PYTHONPATH=/path/to/python/site-packages

     
  • Pranav Jawale

    Pranav Jawale - 2011-07-15

    Hi,

    Now I tried that, I added /path/to/sphinxbase/lib to sys.path in python. Also
    exported LD_LIBRARY_PATH, But error is same (dynamic module).

    Could you please tell what output you get for following two commands in pythin
    shell

    import sphinxbase
    import libsphinxbase

    Thanks.

     
  • Jake

    Jake - 2011-07-15

    I exported them as linux environment variables, not to sys.path.

     
  • Nickolay V. Shmyrev

    import sphinxbase

    This works if you properly define PYTHONPATH and LD_LIBRARY_PATH

    import libsphinxbase

    This one is not supposed to be working

     
  • Pranav Jawale

    Pranav Jawale - 2011-07-16

    Hello,

    Problem solved! Thanks for your help.

    I checked config.log created during sphinxbase install. It said disabling
    python as development headers not found. So I installed python2.7 in its
    source directory where Python.h is present.

    Then installed sphinxbase with

     --with-python/path/to/python2.7/source
    

    argument. This created sphinxbase.so which was earlier missing, and hence I
    thought may be importing libsphinxbase will do as libsphinxbase.so was present
    under sphinabase/lib

    Now I did

    export LD_LIBRARY_PATH /path/to/sphinxbase/lib

    and added /path/to/sphinxbase.so using sys.path.append() in python shell. I am
    root user so can't use PYTHONPATH (ref http://ubuntuforums.org/showthread.php
    ?t=1550747)

    Now import sphinxbase is working fine.

    Thanks again.

     
  • Pranav Jawale

    Pranav Jawale - 2011-07-16

    oops, ,missing "=" after --with-python

     

Log in to post a comment.