error

40 views
Skip to first unread message

abhipo

unread,
May 25, 2017, 9:26:17 AM5/25/17
to bob-devel
ERROR: During the execution, an exception was raised: bob.learn.em.ML_GMMTrainer - cannot perform the e_step method:

Hi , As I understand , this error can be solved by changing RANDOM to RANDOM_NO_DUPLICATE in KMeansTrainer.h. I had installed using pip. How do I compile the code to get the executable.

Manuel Günther

unread,
May 25, 2017, 10:35:00 AM5/25/17
to bob-devel
Could you please post more information, so that we have a chance to help you? What did you try to run? Which packages did you install? Which command line did you use? What is the error message you got, including the complete error backtrace?

Manuel
Message has been deleted

abhipo

unread,
May 25, 2017, 11:48:21 PM5/25/17
to bob-devel
Hello,

I am getting the following error.
Traceback (most recent call last):
  File "/home/avnish/miniconda2/envs/bob_py27/bin/verify.py", line 18, in <module>
    sys.exit(main())
  File "/home/avnish/miniconda2/envs/bob_py27/lib/python2.7/site-packages/bob/bio/base/script/verify.py", line 454, in main
    verify(args, command_line_parameters)
  File "/home/avnish/miniconda2/envs/bob_py27/lib/python2.7/site-packages/bob/bio/base/script/verify.py", line 401, in verify
    if not execute(args):
  File "/home/avnish/miniconda2/envs/bob_py27/lib/python2.7/site-packages/bob/bio/base/script/verify.py", line 290, in execute
    force = args.force)
  File "/home/avnish/miniconda2/envs/bob_py27/lib/python2.7/site-packages/bob/bio/base/tools/algorithm.py", line 58, in train_projector
    algorithm.train_projector(train_features, fs.projector_file)
  File "/home/avnish/miniconda2/envs/bob_py27/lib/python2.7/site-packages/bob/bio/gmm/algorithm/IVector.py", line 140, in train_projector
    self.train_ubm(data)
  File "/home/avnish/miniconda2/envs/bob_py27/lib/python2.7/site-packages/bob/bio/gmm/algorithm/GMM.py", line 131, in train_ubm
    bob.learn.em.train(self.ubm_trainer, self.ubm, array, self.gmm_training_iterations, self.training_threshold, self.rng)
  File "/home/avnish/miniconda2/envs/bob_py27/lib/python2.7/site-packages/bob/learn/em/train.py", line 40, in train
    trainer.e_step(machine, data)

RuntimeError: bob.learn.em.ML_GMMTrainer - cannot perform the e_step method: C++ exception caught: 'logadd: minusdif (-nan) log_b (-nan) or log_a (-12.231939) is nan'

I gave the command

./bin/verify.py -p energy-2gauss  -e mfcc20 -a ivec-cosine-voxforge -s ivector --groups {dev,eval} -vvv -d /home/abhipo/miniconda2/envs/
bob_py27/lib/python2.7/site-packages/bob/bio/spear/config/database/my_custom_db.py -r4  >log_ivector_seq

I noticed that similar error has been reported earlier. The cause is that two means initialized as same values. Therefore RANDOM should be changed t to RANDOM_NO_DUPLICATE in KMeansTrainer.h. How should I compile the code again.
Thanks.

Manuel Günther

unread,
May 26, 2017, 12:50:28 AM5/26/17
to bob-devel
Hi,

there is no need to recompile. Usually this should have been a parameter that you'd set inside a configuration file. However, at the moment this parameter is not defined. I will open a bug-report for this.

In the mean-time, you can hard-code a solution in the python code of bob.bio.gmm, more precisely inside '<conda>/site-packages/bob/bio/gmm/algorithm/GMM.py', where <conda> is you Conda installation path, where bob is installed. Inside the 'GMM.py', please look for the line (should be line number 84)
 self.kmeans_trainer = bob.learn.em.KMeansTrainer()
and replace it with
 self.kmeans_trainer = bob.learn.em.KMeansTrainer('KMEANS_PLUS_PLUS')
This will enable the KMeans++ initialization that would (hopefully) solve your problem. Please let us know if this works for you.


@idiapers: I think we have discussed this before. Should we make KMEANS_PLUS_PLUS the default, at least inside bob.bio.gmm? This would at least avoid that other people have this issue over and over again...

Best wishes
Manuel
Reply all
Reply to author
Forward
0 new messages