Menu

HUB4 NullPointerException

Help
2009-04-03
2012-09-22
  • Kelly Anderson

    Kelly Anderson - 2009-04-03

    Hello, I have been trying to transcribe wav files using the HelloNGram demo and the HUB4 acoustic and language models. I have modified my configuration file to include the hub4 model (as specified in the hub4 performance test) and have changed my manifest file to point to the hub4 jar file. I also changed the path in the build.xml file to point to hub4 instead of wsj. But for some reason, I am getting a NullPointerException when trying to run the HelloNGram demo AND the hub4 test. Here's what I get

    Exception in thread "main" java.lang.NullPointerException
    at edu.cmu.sphinx.model.acoustic.HUB4_8gau_13dCep_16k_40mel_133Hz_6855Hz
    .ModelLoader.loadProperties(ModelLoader.java:372)
    at edu.cmu.sphinx.model.acoustic.HUB4_8gau_13dCep_16k_40mel_133Hz_6855Hz
    .ModelLoader.getIsBinaryDefault(ModelLoader.java:386)
    at edu.cmu.sphinx.model.acoustic.HUB4_8gau_13dCep_16k_40mel_133Hz_6855Hz
    .ModelLoader.newProperties(ModelLoader.java:346)
    at edu.cmu.sphinx.util.props.ConfigurationManager.lookup(ConfigurationMa
    nager.java:214)
    at edu.cmu.sphinx.util.props.ValidatingPropertySheet.getComponent(Valida
    tingPropertySheet.java:403)
    at edu.cmu.sphinx.model.acoustic.HUB4_8gau_13dCep_16k_40mel_133Hz_6855Hz
    .Model.newProperties(Model.java:159)
    at edu.cmu.sphinx.util.props.ConfigurationManager.lookup(ConfigurationMa
    nager.java:214)
    at edu.cmu.sphinx.util.props.ValidatingPropertySheet.getComponent(Valida
    tingPropertySheet.java:403)
    at edu.cmu.sphinx.linguist.lextree.LexTreeLinguist.newProperties(LexTree
    Linguist.java:341)
    at edu.cmu.sphinx.util.props.ConfigurationManager.lookup(ConfigurationMa
    nager.java:214)
    at edu.cmu.sphinx.util.props.ValidatingPropertySheet.getComponent(Valida
    tingPropertySheet.java:403)
    at edu.cmu.sphinx.decoder.search.WordPruningBreadthFirstSearchManager.ne
    wProperties(WordPruningBreadthFirstSearchManager.java:267)
    at edu.cmu.sphinx.util.props.ConfigurationManager.lookup(ConfigurationMa
    nager.java:214)
    at edu.cmu.sphinx.util.props.ValidatingPropertySheet.getComponent(Valida
    tingPropertySheet.java:403)
    at edu.cmu.sphinx.decoder.Decoder.newProperties(Decoder.java:71)
    at edu.cmu.sphinx.util.props.ConfigurationManager.lookup(ConfigurationMa
    nager.java:214)
    at edu.cmu.sphinx.util.props.ValidatingPropertySheet.getComponent(Valida
    tingPropertySheet.java:403)
    at edu.cmu.sphinx.recognizer.Recognizer.newProperties(Recognizer.java:93
    )
    at edu.cmu.sphinx.util.props.ConfigurationManager.lookup(ConfigurationMa
    nager.java:214)
    at demo.sphinx.hellongram.HelloNGram.main(HelloNGram.java:55)

    I've been spending the whole day trying to find out on these forums any solution for my problem but I can't seem to find anything. Am I missing something here?

     
    • Kelly Anderson

      Kelly Anderson - 2009-04-23

      Nevermind, i fixed the problem. Used Netbeans instead of the command prompt to build and run the project. :)

       
    • Kelly Anderson

      Kelly Anderson - 2009-04-03

      Sorry, I forgot to mention that I'm using Sphinx4.

       
      • Nickolay V. Shmyrev

        You also forgot to mention the version of sphinx4 you are using.

         
    • Kelly Anderson

      Kelly Anderson - 2009-04-03

      Yeah wow..sorry about that. I'm using version 1.0 beta1.

       
      • Nickolay V. Shmyrev

        The jar we provide is supposed to work with beta2

         
    • Kelly Anderson

      Kelly Anderson - 2009-04-03

      Really? I'm using HUB4_8gau_13dCep_16k_40mel_133Hz_6855Hz.jar and not HUB4_beta2_8gau_13dCep_16k_40mel_133Hz_6855Hz.jar or are both of them designed to work for Sphinx4 beta2?

       
      • Nickolay V. Shmyrev

        Please use beta2 both sphinx4 and HUB4

         
    • Kelly Anderson

      Kelly Anderson - 2009-04-05

      Alright, I tried beta2 and I'm getting the same errors. Again, I have included HUB4 in the build.xml file and it built the jar and class files in the bld folder. I also modified the manifest file to point to the JAR file of HUB4.

      I am very perplexed by this. Any step that I'm missing there?

       
      • Nickolay V. Shmyrev

        Btw, you can download my test sample here:

        http://www.mediafire.com/download.php?dlmpmdz2byo

         
      • Nickolay V. Shmyrev

        Can you share the jar and the source with your modifications?

         
    • Kelly Anderson

      Kelly Anderson - 2009-04-07

      I checked your files, and they don't seem to be different than mine at all.

      Here are my files, I included the demo.xml and build.xml too...I'm using the hellongram.trigram file but renamed it to test.trigram (as if that would make any difference...).

      http://rapidshare.com/files/218625685/Test.rar.html

      Thank you very much for your time. I apologize if this all turns out to be a very silly mistake that I was not aware of.

       
      • Nickolay V. Shmyrev

        There are few issues in your jar:

        1) in config.xml although HUB4 jar starts with HUB4_beta2 the class name is still edu.cmu.sphinx.model.acoustic.HUB4_8gau_13dCep_16k_40mel_133Hz_6855Hz
        so you need to fix both model and loader

        2) In demo you load wave files from a resources from jar, but you don't pack them into jar. Either pack test8 with build script or load it from the file system.

        Otherwise everything works.

         
    • Kelly Anderson

      Kelly Anderson - 2009-04-09

      Fixed issue number 2, thanks for the tip.

      As for issue number 1, I changed the name in config.xml but I'm still getting the same error, so I went and changed the build.xml to remove the beta2 part and I'm still getting an error. Any help?

       
      • Nickolay V. Shmyrev

        > so I went and changed the build.xml to remove the beta2 part and I'm still getting an error. Any help?

        No, you shouldn't change anything in build.xml. Make sure that jar is placed in lib and you run it properly as

        java -jar bin/Wavfile.jar

        just be careful and try to understand what happens. I'm sure you'll be able to solve this :)

         
    • Kelly Anderson

      Kelly Anderson - 2009-04-16

      I decided to do a clean build, the hub4 jar is in the lib and the classes are in the bld folder. Now, I'm getting a "class not found" exception. I find it very odd since the classes were successfully built and extracted from the jar and since my classpath in the manifest file points to the hub4 jar.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.