bob.learn.em issueshttps://gitlab.idiap.ch/bob/bob.learn.em/-/issues2017-08-12T07:46:06Zhttps://gitlab.idiap.ch/bob/bob.learn.em/-/issues/17Segmentation fault when importing bob.learn.em2017-08-12T07:46:06ZAndré AnjosSegmentation fault when importing bob.learn.em*Created by: 183amir*
Backtrace:
```
gdb -ex r --args /opt/conda/envs/_test/bin/python -c "import bob.learn.em"
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-83.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: G...*Created by: 183amir*
Backtrace:
```
gdb -ex r --args /opt/conda/envs/_test/bin/python -c "import bob.learn.em"
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-83.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /opt/conda/envs/_test/bin/python...done.
Starting program: /opt/conda/envs/_test/bin/python -c import\ bob.learn.em
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffa000
[Thread debugging using libthread_db enabled]
Detaching after fork from child process 73.
Missing separate debuginfo for /opt/conda/envs/_test/lib/python2.7/site-packages/numpy/core/../../../.././libgfortran.so.3
[New Thread 0x7ffff0176700 (LWP 75)]
[New Thread 0x7fffef975700 (LWP 76)]
[New Thread 0x7fffed174700 (LWP 77)]
warning: Source file is more recent than executable.
Program received signal SIGSEGV, Segmentation fault.
bob::extension::FunctionDoc::doc(unsigned int, unsigned int) const () at /opt/conda/envs/_build/lib/python2.7/site-packages/bob/extension/include/bob.extension/documentation.h:580
580 if (description.empty()){
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.166.el6_7.7.x86_64
(gdb) bt
#0 bob::extension::FunctionDoc::doc(unsigned int, unsigned int) const () at /opt/conda/envs/_build/lib/python2.7/site-packages/bob/extension/include/bob.extension/documentation.h:580
#1 0x00007fffe441477b in _GLOBAL__sub_I_main.cpp () at bob/learn/em/main.cpp:18
#2 0x00007fffe4414826 in __do_global_ctors_aux () from /opt/conda/envs/_test/lib/python2.7/site-packages/bob/learn/em/_library.so
#3 0x00007fffe4391d03 in _init () from /opt/conda/envs/_test/lib/python2.7/site-packages/bob/learn/em/_library.so
#4 0x00007fff00000000 in ?? ()
#5 0x00007ffff7deb625 in _dl_init_internal () from /lib64/ld-linux-x86-64.so.2
#6 0x00007ffff7defe95 in dl_open_worker () from /lib64/ld-linux-x86-64.so.2
#7 0x00007ffff7deb286 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#8 0x00007ffff7def63a in _dl_open () from /lib64/ld-linux-x86-64.so.2
#9 0x00007ffff75d5f66 in dlopen_doit () from /lib64/libdl.so.2
#10 0x00007ffff7deb286 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#11 0x00007ffff75d629c in _dlerror_run () from /lib64/libdl.so.2
#12 0x00007ffff75d5ee1 in dlopen@@GLIBC_2.2.5 () from /lib64/libdl.so.2
#13 0x00007ffff7b25dde in _PyImport_GetDynLoadFunc (fqname=<value optimized out>, shortname=<value optimized out>, pathname=0xd34c60 "/opt/conda/envs/_test/lib/python2.7/site-packages/bob/learn/em/_library.so", fp=0xd39730) at Python/dynload_shlib.c:130
#14 0x00007ffff7b0a8d8 in _PyImport_LoadDynamicModule (name=0xcf9fb0 "bob.learn.em._library", pathname=0xd34c60 "/opt/conda/envs/_test/lib/python2.7/site-packages/bob/learn/em/_library.so", fp=0xd39730) at ./Python/importdl.c:42
#15 0x00007ffff7b08f81 in import_submodule (mod=0x7ffff7eaada8, subname=0xcf9fbd "_library", fullname=0xcf9fb0 "bob.learn.em._library") at Python/import.c:2704
#16 0x00007ffff7b091f4 in load_next (mod=0x7ffff7eaada8, altmod=0x7ffff7eaada8, p_name=<value optimized out>, buf=0xcf9fb0 "bob.learn.em._library", p_buflen=0x7fffffffe120) at Python/import.c:2519
#17 0x00007ffff7b09820 in import_module_level (name=<value optimized out>, globals=<value optimized out>, locals=<value optimized out>, fromlist=0x7ffff7ef69d0, level=<value optimized out>) at Python/import.c:2228
#18 PyImport_ImportModuleLevel (name=<value optimized out>, globals=<value optimized out>, locals=<value optimized out>, fromlist=0x7ffff7ef69d0, level=<value optimized out>) at Python/import.c:2292
#19 0x00007ffff7ae914f in builtin___import__ (self=<value optimized out>, args=<value optimized out>, kwds=<value optimized out>) at Python/bltinmodule.c:49
#20 0x00007ffff7a3fd23 in PyObject_Call (func=0x7ffff7fdffc8, arg=<value optimized out>, kw=<value optimized out>) at Objects/abstract.c:2546
#21 0x00007ffff7ae9633 in PyEval_CallObjectWithKeywords (func=0x7ffff7fdffc8, arg=0x7ffff7e935f0, kw=<value optimized out>) at Python/ceval.c:4219
#22 0x00007ffff7aee29e in PyEval_EvalFrameEx (f=<value optimized out>, throwflag=<value optimized out>) at Python/ceval.c:2622
#23 0x00007ffff7af3a2e in PyEval_EvalCodeEx (co=0x7ffff7eb08b0, globals=<value optimized out>, locals=<value optimized out>, args=<value optimized out>, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:3582
#24 0x00007ffff7af3b42 in PyEval_EvalCode (co=<value optimized out>, globals=<value optimized out>, locals=<value optimized out>) at Python/ceval.c:669
#25 0x00007ffff7b05a82 in PyImport_ExecCodeModuleEx (name=0x6b61b0 "bob.learn.em", co=0x7ffff7eb08b0, pathname=0x6b91e0 "/opt/conda/envs/_test/lib/python2.7/site-packages/bob/learn/em/__init__.pyc") at Python/import.c:713
#26 0x00007ffff7b081ce in load_source_module (name=0x6b61b0 "bob.learn.em", pathname=0x6b91e0 "/opt/conda/envs/_test/lib/python2.7/site-packages/bob/learn/em/__init__.pyc", fp=<value optimized out>) at Python/import.c:1103
#27 0x00007ffff7b08a2a in load_package (name=0x6b61b0 "bob.learn.em", pathname=<value optimized out>) at Python/import.c:1170
#28 0x00007ffff7b08f81 in import_submodule (mod=0x7ffff7eaad38, subname=0x6b61ba "em", fullname=0x6b61b0 "bob.learn.em") at Python/import.c:2704
#29 0x00007ffff7b091f4 in load_next (mod=0x7ffff7eaad38, altmod=0x7ffff7eaad38, p_name=<value optimized out>, buf=0x6b61b0 "bob.learn.em", p_buflen=0x7fffffffe710) at Python/import.c:2519
#30 0x00007ffff7b09860 in import_module_level (name=<value optimized out>, globals=<value optimized out>, locals=<value optimized out>, fromlist=0x7ffff7da6cd0, level=<value optimized out>) at Python/import.c:2236
#31 PyImport_ImportModuleLevel (name=<value optimized out>, globals=<value optimized out>, locals=<value optimized out>, fromlist=0x7ffff7da6cd0, level=<value optimized out>) at Python/import.c:2292
#32 0x00007ffff7ae914f in builtin___import__ (self=<value optimized out>, args=<value optimized out>, kwds=<value optimized out>) at Python/bltinmodule.c:49
#33 0x00007ffff7a3fd23 in PyObject_Call (func=0x7ffff7fdffc8, arg=<value optimized out>, kw=<value optimized out>) at Objects/abstract.c:2546
#34 0x00007ffff7ae9633 in PyEval_CallObjectWithKeywords (func=0x7ffff7fdffc8, arg=0x7ffff7ed15d0, kw=<value optimized out>) at Python/ceval.c:4219
#35 0x00007ffff7aee29e in PyEval_EvalFrameEx (f=<value optimized out>, throwflag=<value optimized out>) at Python/ceval.c:2622
#36 0x00007ffff7af3a2e in PyEval_EvalCodeEx (co=0x7ffff7edde30, globals=<value optimized out>, locals=<value optimized out>, args=<value optimized out>, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:3582
#37 0x00007ffff7af3b42 in PyEval_EvalCode (co=<value optimized out>, globals=<value optimized out>, locals=<value optimized out>) at Python/ceval.c:669
#38 0x00007ffff7b125cc in run_mod (str=0x601010 "import bob.learn.em\n", start=257, globals=0x7ffff7f81168, locals=0x7ffff7f81168, flags=<value optimized out>) at Python/pythonrun.c:1370
#39 PyRun_StringFlags (str=0x601010 "import bob.learn.em\n", start=257, globals=0x7ffff7f81168, locals=0x7ffff7f81168, flags=<value optimized out>) at Python/pythonrun.c:1333
#40 0x00007ffff7b138f0 in PyRun_SimpleStringFlags (command=0x601010 "import bob.learn.em\n", flags=0x7fffffffebc0) at Python/pythonrun.c:974
#41 0x00007ffff7b29457 in Py_Main (argc=<value optimized out>, argv=<value optimized out>) at Modules/main.c:589
#42 0x00007ffff6dd8d5d in __libc_start_main () from /lib64/libc.so.6
#43 0x0000000000400649 in _start ()
```
conda-forge pull request:
https://github.com/conda-forge/staged-recipes/pull/4092.0.9https://gitlab.idiap.ch/bob/bob.learn.em/-/issues/14Test fails on python 3.52017-08-12T07:46:06ZAndré AnjosTest fails on python 3.5*Created by: pkorshunov*
It seems that test 'bob.learn.em.test.test_gmm.test_GMMMachine_1' fails on travis when built for python 3.5
*Created by: pkorshunov*
It seems that test 'bob.learn.em.test.test_gmm.test_GMMMachine_1' fails on travis when built for python 3.5
https://gitlab.idiap.ch/bob/bob.learn.em/-/issues/12gmm.acc_statistics crashes on 32-bits Ubuntu2017-08-12T07:46:06ZAndré Anjosgmm.acc_statistics crashes on 32-bits Ubuntu*Created by: pkorshunov*
A doctest example in guide.rst (line 147) fails when call to gmm.acc_statistics() is made. The following exception is raised:
RuntimeError: bob.learn.em.GMMMachine - cannot accumulate the statistics: C++ except...*Created by: pkorshunov*
A doctest example in guide.rst (line 147) fails when call to gmm.acc_statistics() is made. The following exception is raised:
RuntimeError: bob.learn.em.GMMMachine - cannot accumulate the statistics: C++ exception caught: 'array dimensions do not match 33 != 3'
Here is the complete buildlog and the reported error when run on 32-bits Ubuntu Trusty:
https://launchpadlibrarian.net/229434954/buildlog_ubuntu-trusty-i386.bob.learn.em_2.0.6-0~ppa5~trusty1_BUILDING.txt.gz
https://gitlab.idiap.ch/bob/bob.learn.em/-/issues/7bob.learn.em.znorm() does not work2017-08-12T07:46:06ZAndré Anjosbob.learn.em.znorm() does not work*Created by: ivana7c*
When calling the following function, we end up with the following error:
```python
A = numpy.array([[1, 2, 3, 4, 5], [6, 7, 8, 9, 8], [7, 6, 5, 4, 3]], numpy.float64)
B = numpy.array([[5, 4, 7, 8],[9, 8, 7, 4],[...*Created by: ivana7c*
When calling the following function, we end up with the following error:
```python
A = numpy.array([[1, 2, 3, 4, 5], [6, 7, 8, 9, 8], [7, 6, 5, 4, 3]], numpy.float64)
B = numpy.array([[5, 4, 7, 8],[9, 8, 7, 4],[5, 6, 3, 2]], numpy.float64)
normalized_scores = bob.learn.em.znorm(A, B)
Usage (for details, see help):
ztnorm(rawscores_probes_vs_models,rawscores_zprobes_vs_models,rawscores_probes_vs_tmodels,rawscores_zprobes_vs_tmodels,mask_zprobes_vs_tmodels_istruetrial) -> output
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: More keyword list entries (5) than format specifiers (2)
```
There is something wrong with the python bindings. In addition, the tests are wrong as well, since this problem didn't show up earlier.
It was working well on the former major release of bob.https://gitlab.idiap.ch/bob/bob.learn.em/-/issues/5division by zero2017-08-12T07:46:06ZAndré Anjosdivision by zero*Created by: khoury*
In train.py, a division by zero error occurred at line 53:
```py
if convergence_threshold!=None and abs((average_output_previous - average_output)/average_output_previous) <= convergence_threshold:
```
in case...*Created by: khoury*
In train.py, a division by zero error occurred at line 53:
```py
if convergence_threshold!=None and abs((average_output_previous - average_output)/average_output_previous) <= convergence_threshold:
```
in case `convergence_threshold` is not None and the trainer does not contain a `compute_likelihood` attribute.https://gitlab.idiap.ch/bob/bob.learn.em/-/issues/4Wrong error return in BOB_CATCH_MEMBER2017-08-12T07:46:06ZAndré AnjosWrong error return in BOB_CATCH_MEMBER*Created by: siebenkopf*
It appears that for some functions, the error return is ``-1`` and not ``NULL``. Usually, those functions return ``int`` and not ``PyObject*``. Particularly, this is the case for the constructors such as:
https...*Created by: siebenkopf*
It appears that for some functions, the error return is ``-1`` and not ``NULL``. Usually, those functions return ``int`` and not ``PyObject*``. Particularly, this is the case for the constructors such as:
https://github.com/bioidiap/bob.learn.em/blob/master/bob/learn/em/kmeans_trainer.cpp#L119
and for the setter functions such as:
https://github.com/bioidiap/bob.learn.em/blob/master/bob/learn/em/kmeans_trainer.cpp#L257
This means that the second value in the ``BOB_CATCH_MEMBER`` construct needs to be ``-1`` and not ``NULL`` (aka. ``0``).
@tiagofrepereira2012: could you go through all the files and assure that the error return is correct?https://gitlab.idiap.ch/bob/bob.learn.em/-/issues/6Test fails with numpy version 1.9.12022-02-11T15:08:22ZAndré AnjosTest fails with numpy version 1.9.1*Created by: siebenkopf*
When compiling against numpy version 1.9.1, one of the tests fail, regardless of the python version: ``bob.learn.em.test.test_plda_trainer.test_plda_EM_vs_Python``; see: https://travis-ci.org/bioidiap/bob.learn....*Created by: siebenkopf*
When compiling against numpy version 1.9.1, one of the tests fail, regardless of the python version: ``bob.learn.em.test.test_plda_trainer.test_plda_EM_vs_Python``; see: https://travis-ci.org/bioidiap/bob.learn.em/jobs/63327282.
However, with the latest numpy version, the test passes again, see: https://travis-ci.org/bioidiap/bob.learn.em/jobs/63453315
Also, with older numpy versions the test seems to pass. So, maybe it is just an issue with this numpy version, and not with ``bob.learn.em``. It would be nice to investigate that further.
Manuelhttps://gitlab.idiap.ch/bob/bob.learn.em/-/issues/49dask problem with fitting GMMMachine ...2022-11-10T12:13:55ZPasra Rahimidask problem with fitting GMMMachine ...Can you guys check this error? The original script can be found at `/idiap/temp/prahimi/latentplay/gmm/gmm.py`
```bash
Loading latent data ...
Done loading.
(50000, 9216)
Working on GMMMachine with number of mixture models set to : 10...Can you guys check this error? The original script can be found at `/idiap/temp/prahimi/latentplay/gmm/gmm.py`
```bash
Loading latent data ...
Done loading.
(50000, 9216)
Working on GMMMachine with number of mixture models set to : 10
Traceback (most recent call last):
File "/somewhere/exps/latentplay/gmm/gmm.py", line 38, in <module>
machine = machine.fit(latents)
File "/somewhere/mambaforge/envs/latentplay/lib/python3.10/site-packages/bob/learn/em/gmm.py", line 792, in fit
self.initialize_gaussians(X)
File "/somewhere/mambaforge/envs/latentplay/lib/python3.10/site-packages/bob/learn/em/gmm.py", line 731, in initialize_gaussians
kmeans_machine = kmeans_machine.fit(data)
File "/somewhere/mambaforge/envs/latentplay/lib/python3.10/site-packages/bob/learn/em/kmeans.py", line 328, in fit
self.initialize(data=X)
File "/somewhere/mambaforge/envs/latentplay/lib/python3.10/site-packages/bob/learn/em/kmeans.py", line 312, in initialize
self.centroids_ = k_init(
File "/somewhere/mambaforge/envs/latentplay/lib/python3.10/site-packages/dask_ml/cluster/k_means.py", line 365, in k_init
return init_scalable(X, n_clusters, random_state, max_iter, oversampling_factor)
File "/somewhere/mambaforge/envs/latentplay/lib/python3.10/site-packages/dask_ml/utils.py", line 550, in wraps
results = f(*args, **kwargs)
File "/somewhere/mambaforge/envs/latentplay/lib/python3.10/site-packages/dask_ml/cluster/k_means.py", line 423, in init_scalable
(cost,) = compute(evaluate_cost(X, centers))
File "/somewhere/mambaforge/envs/latentplay/lib/python3.10/site-packages/dask_ml/cluster/k_means.py", line 486, in evaluate_cost
return (pairwise_distances(X, centers).min(1) ** 2).sum()
File "/somewhere/mambaforge/envs/latentplay/lib/python3.10/site-packages/dask_ml/metrics/pairwise.py", line 59, in pairwise_distances
return X.map_blocks(
File "/somewhere/mambaforge/envs/latentplay/lib/python3.10/site-packages/dask/array/core.py", line 2676, in map_blocks
return map_blocks(func, self, *args, **kwargs)
File "/somewhere/mambaforge/envs/latentplay/lib/python3.10/site-packages/dask/array/core.py", line 873, in map_blocks
out = blockwise(
File "/somewhere/mambaforge/envs/latentplay/lib/python3.10/site-packages/dask/array/blockwise.py", line 269, in blockwise
raise ValueError(
ValueError: Dimension 1 has 2 blocks, adjust_chunks specified with 1 blocks
```Flavio TARSETTIFlavio TARSETTI