numpy.nan detected in 'data'

41 views
Skip to first unread message

Reng Xian Tiong

unread,
Sep 6, 2017, 11:12:28 AM9/6/17
to bob-devel
Hi, 

I'm trying to input my own database into bob-spear, however, I received a few warnings and error as below:

bob.bio.spear@2017-09-06 11:01:12,472 -- INFO: After 2 Gaussian Energy-based VAD there are 26 frames remaining over 74

bob.bio.spear@2017-09-06 11:01:12,482 -- INFO: After 2 Gaussian Energy-based VAD there are 34 frames remaining over 73

/home/ubuntu/anaconda3/envs/bob_py3/lib/python3.6/site-packages/bob/bio/spear/utils/__init__.py:137: RuntimeWarning: divide by zero encountered in true_divide

 arrayset[i,:] = (vector[i]-mean) / std

/home/ubuntu/anaconda3/envs/bob_py3/lib/python3.6/site-packages/bob/bio/spear/utils/__init__.py:137: RuntimeWarning: invalid value encountered in true_divide

 arrayset[i,:] = (vector[i]-mean) / std

/home/ubuntu/anaconda3/envs/bob_py3/lib/python3.6/site-packages/bob/bio/spear/utils/__init__.py:126: RuntimeWarning: invalid value encountered in add

 mean += x

bob.bio.base@2017-09-06 11:01:14,748 -- ERROR: During the execution, an exception was raised: Please, check your inputs; numpy.nan detected in `data`

Traceback (most recent call last):

 File "/home/ubuntu/anaconda3/envs/bob_py3/bin/verify.py", line 6, in <module>

   sys.exit(bob.bio.base.script.verify.main())

 File "/home/ubuntu/anaconda3/envs/bob_py3/lib/python3.6/site-packages/bob/bio/base/script/verify.py", line 454, in main

   verify(args, command_line_parameters)

 File "/home/ubuntu/anaconda3/envs/bob_py3/lib/python3.6/site-packages/bob/bio/base/script/verify.py", line 434, in verify

   if not execute(args):

 File "/home/ubuntu/anaconda3/envs/bob_py3/lib/python3.6/site-packages/bob/bio/base/script/verify.py", line 290, in execute

   force = args.force)

 File "/home/ubuntu/anaconda3/envs/bob_py3/lib/python3.6/site-packages/bob/bio/base/tools/algorithm.py", line 56, in train_projector

   algorithm.train_projector(train_features, fs.projector_file)

 File "/home/ubuntu/anaconda3/envs/bob_py3/lib/python3.6/site-packages/bob/bio/gmm/algorithm/GMM.py", line 148, in train_projector

   self.train_ubm(array)

 File "/home/ubuntu/anaconda3/envs/bob_py3/lib/python3.6/site-packages/bob/bio/gmm/algorithm/GMM.py", line 115, in train_ubm

   bob.learn.em.train(self.kmeans_trainer, kmeans, array, self.kmeans_training_iterations, self.training_threshold, self.rng)

 File "/home/ubuntu/anaconda3/envs/bob_py3/lib/python3.6/site-packages/bob/learn/em/train.py", line 44, in train

   raise ValueError("Please, check your inputs; numpy.nan detected in `data` ")

ValueError: Please, check your inputs; numpy.nan detected in `data`



Is it the warning (highlighted in yellow) cause the error (highlighted in red)? 
If yes, what causes the warning shown up? 

And what is the solution for all the warnings and error?



Regards,
Reng Xian

Tiago Freitas Pereira

unread,
Sep 6, 2017, 11:28:54 AM9/6/17
to bob-...@googlegroups.com
Hi Reng,

Well, check your inputs; maybe you have some corrupted file.

Cheers



--
-- You received this message because you are subscribed to the Google Groups bob-devel group. To post to this group, send email to bob-...@googlegroups.com. To unsubscribe from this group, send email to bob-devel+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/bob-devel or directly the project website at http://idiap.github.com/bob/
---
You received this message because you are subscribed to the Google Groups "bob-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bob-devel+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Tiago

Manuel Günther

unread,
Sep 6, 2017, 12:05:40 PM9/6/17
to bob-devel
When reading the warning messages (specifically the first one), it seems that the standard deviation (`std`) of your data is zero. This can come from two different reasons: 

  1. You have only one data point. In this case, the standard deviation is always zero -- you need at least two points to calculate the standard deviation.
  2. All the data in at least one dimension of your data vector are identical -- in this case the variance (and therewith the standard deviation) is zero, too.

Let us know if this is the case.

Manuel

Reng Xian Tiong

unread,
Sep 12, 2017, 1:02:16 AM9/12/17
to bob-devel
Thanks Tiago and Manuel for the reply.
 
I had checked through the output of feature extraction, exactly like Manuel mentioned in (2.), quite a number of columns contains identical data within the same column. 

I am suspecting the root cause of this problem is due to my input database as I do segmentation outside bob-spear to break every single voice activity into single .wav file before I feed into bob-spear.

After all, it seems like I have done something extra. I feed my raw data (with multiple voice activities in one .wav file) into spear and is working fine without error.


Regards,
Reng Xian
Reply all
Reply to author
Forward
0 new messages