pyAudioAnalysis
pyAudioAnalysis copied to clipboard
Diarization Example fails with UnboundLocalError: local variable 'MEAN' referenced before assignment
I am trying to run the unsupervised segmentation example explained here.
I am running the following command:
python audioAnalysis.py segmentClassifyFile -i data/scottish.wav
I get the following error:
Plaintext Error
Traceback (most recent call last): File "audioAnalysis.py", line 586, in <module> segmentclassifyFileWrapper(args.input, args.modelName, args.model) File "audioAnalysis.py", line 203, in segmentclassifyFileWrapper aS.mtFileClassification(inputWavFile, model_name, model_type, True, gtFile) File "/home/jspear/Development/diarization/pyAudioAnalysis/pyAudioAnalysis/audioSegmentation.py", line 519, in mtFileClassification compute_beat] = aT.load_model(model_name) File "/home/jspear/Development/diarization/pyAudioAnalysis/pyAudioAnalysis/audioTrainTest.py", line 580, in load_model MEAN = numpy.array(MEAN) UnboundLocalError: local variable 'MEAN' referenced before assignment
I am using Python 2.7, running the latest version of the code as of 2018-October-19th (commit cee48de0df)
Any help would be appreciated.
Thank you for your comment. It seems that this is due to the fact that the model used in this function has been trained in python 3. Have you tried running the code in python 3?
When I run with python 3.5.2 I get the following error:
Plaintext
Traceback (most recent call last): File "audioAnalysis.py", line 9, in <module> from pyAudioAnalysis import audioSegmentation as aS File "/home/jspear/Development/diarization/pyAudioAnalysis/pyAudioAnalysis/audioSegmentation.py", line 16, in <module> import hmmlearn.hmm File "/home/jspear/.virtualenvs/diarization3/lib/python3.5/site-packages/hmmlearn/hmm.py", line 20, in <module> from .base import _BaseHMM File "/home/jspear/.virtualenvs/diarization3/lib/python3.5/site-packages/hmmlearn/base.py", line 13, in <module> from . import _hmmc ImportError: /home/jspear/.virtualenvs/diarization3/lib/python3.5/site-packages/hmmlearn/_hmmc.cpython-35m-x86_64-linux-gnu.so: undefined symbol: npy_fabsl
@tyiannak Does running this command work for you? If so, could you provide which version of python you are using as well as the output of running pip freeze?
I believe this may be a package versioning issue.
Hi.
I am having the same issue.
I have the same issue 'MEAN'.
Well, i had the same problem with npy_fabsl using virtualenv, outside virtualenv works fine.
I have the same issue with npy_fabsl using virtualenv and even outside virtualenv. Someone has any solution?
Same here, but the message is UnboundLocalError: local variable 'STD' referenced before assignment