pyAudioAnalysis icon indicating copy to clipboard operation
pyAudioAnalysis copied to clipboard

Diarization Example fails with UnboundLocalError: local variable 'MEAN' referenced before assignment

Open Joboman555 opened this issue 6 years ago • 8 comments

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:

image

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.

Joboman555 avatar Oct 19 '18 21:10 Joboman555

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?

tyiannak avatar Oct 20 '18 13:10 tyiannak

When I run with python 3.5.2 I get the following error:

image

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

Joboman555 avatar Oct 20 '18 15:10 Joboman555

@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.

Joboman555 avatar Oct 20 '18 15:10 Joboman555

Hi. I am having the same issue. imagen

leoxagy12 avatar Nov 02 '18 19:11 leoxagy12

I have the same issue 'MEAN'.

zhengqun avatar Nov 20 '18 01:11 zhengqun

Well, i had the same problem with npy_fabsl using virtualenv, outside virtualenv works fine.

divisiondeariza avatar Dec 01 '18 07:12 divisiondeariza

I have the same issue with npy_fabsl using virtualenv and even outside virtualenv. Someone has any solution?

laleye avatar Dec 02 '18 10:12 laleye

Same here, but the message is UnboundLocalError: local variable 'STD' referenced before assignment

diogomoreira avatar Sep 17 '19 01:09 diogomoreira