DCASE-REPO / dcase_util

A collection of utilities for Detection and Classification of Acoustic Scenes and Events
https://dcase-repo.github.io/dcase_util/
MIT License
129 stars 33 forks source link

unable to install dcase_util from source due to latest librosa #11

Closed rjkat closed 6 years ago

rjkat commented 6 years ago

Description

The latest librosa depends on llvmlite, which is broken with LLVM 6.0.0, which means it's not possible to import dcase_util when installing from source. This is necessary when working on a platform which doesn't have precompiled binaries. Please consider downgrading librosa.

LLVM issue references: https://bugs.llvm.org/show_bug.cgi?id=35947 https://reviews.llvm.org/D44140

Steps/Code to Reproduce

Install dcase_util from source:

pip install -v --ignore-installed --no-binary :all: dcase_util
import dcase_util

Expected Results

Should be able to import dcase_util.

Actual Results

$ python
Python 2.7.11 (default, May 25 2016, 14:24:28)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import dcase_util
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/short/wa66/rk9125/lib/python2.7/site-packages/dcase_util/__init__.py", line 6, in <module>
    from . import containers
  File "/short/wa66/rk9125/lib/python2.7/site-packages/dcase_util/containers/__init__.py", line 948, in <module>
    from .audio import *
  File "/short/wa66/rk9125/lib/python2.7/site-packages/dcase_util/containers/audio.py", line 11, in <module>
    import librosa
  File "/short/wa66/rk9125/lib/python2.7/site-packages/librosa/__init__.py", line 12, in <module>
    from . import core
  File "/short/wa66/rk9125/lib/python2.7/site-packages/librosa/core/__init__.py", line 102, in <module>
    from .time_frequency import *  # pylint: disable=wildcard-import
  File "/short/wa66/rk9125/lib/python2.7/site-packages/librosa/core/time_frequency.py", line 10, in <module>
    from ..util.exceptions import ParameterError
  File "/short/wa66/rk9125/lib/python2.7/site-packages/librosa/util/__init__.py", line 70, in <module>
    from . import decorators
  File "/short/wa66/rk9125/lib/python2.7/site-packages/librosa/util/decorators.py", line 9, in <module>
    from numba.decorators import jit as optional_jit
  File "/short/wa66/rk9125/lib/python2.7/site-packages/numba/__init__.py", line 10, in <module>
    from . import config, errors, runtests, types
  File "/short/wa66/rk9125/lib/python2.7/site-packages/numba/config.py", line 11, in <module>
    import llvmlite.binding as ll
  File "/short/wa66/rk9125/lib/python2.7/site-packages/llvmlite/binding/__init__.py", line 6, in <module>
    from .dylib import *
  File "/short/wa66/rk9125/lib/python2.7/site-packages/llvmlite/binding/dylib.py", line 4, in <module>
    from . import ffi
  File "/short/wa66/rk9125/lib/python2.7/site-packages/llvmlite/binding/ffi.py", line 128, in <module>
    raise e
OSError: /short/wa66/rk9125/lib/python2.7/site-packages/llvmlite/binding/libllvmlite.so: undefined symbol: LLVMInitializeInstCombine

Versions

NumPy 1.11.0 SciPy 1.1.0 Matplotlib 1.5.1 librosa 0.6.0

toni-heittola commented 6 years ago

Librosa is used in the case_util for audio file reading and feature extraction related functionality. dcase_util should work with librosa version 0.5.1 in most use cases. There are only a few cases where 0.6.0 is required, e.g. RMSEnergyExtractor parameter n_fft would not work. However, I do not see any strong reason to downgrade librosa version requirement. I would not like to maintain different code/functionality depending on librosa version.

You could try to downgrade your librosa version to 0.5.1, and see can you import dcase_util then.

rjkat commented 6 years ago

Downgrading to 0.5.1 didn't help, I ended up having to go all the way back to 0.4.

librosa 0.4 doesn't have support for resizing user-supplied windows for the stft. I encountered this error:

librosa.util.exceptions.ParameterError: Size mismatch between n_fft and len(window)

I ended up changing n_fft to 640 to make it match the length of the window. I imagine this will cause my feature extraction to be slower.

Is this an appropriate way of resolving this issue? Do you have any other advice?

toni-heittola commented 6 years ago

Your extracted features might not match with the ones extracted with current librosa version. However, if you are not trying to recreate some system implemented on top of dcase_util this should not be a problem.

On which platform your are operating? Would using anaconda/miniconda type of python distribution help?

toni-heittola commented 6 years ago

This issue was closed as there was no follow up from author for at least 4 weeks. Feel free to reopen issue if needed.