tyiannak / pyAudioAnalysis

Python Audio Analysis Library: Feature Extraction, Classification, Segmentation and Applications
Apache License 2.0
5.8k stars 1.19k forks source link

Getting new ValueError in classifyFolderWrapper #263

Open JoshuaDPitts opened 4 years ago

JoshuaDPitts commented 4 years ago

I am attempting to get the classifier working with the following: python ../pyAudioAnalysis/pyAudioAnalysis/audioAnalysis.py classifyFolder -i samples/ --model knn --classifier knnBarkDetect building off this project.

I get the following error output: Traceback (most recent call last): File "../pyAudioAnalysis/pyAudioAnalysis/audioAnalysis.py", line 603, in <module> args.details) File "../pyAudioAnalysis/pyAudioAnalysis/audioAnalysis.py", line 136, in classifyFolderWrapper model_type) File "/Users/jpitts/Temp/bark1/virtual_env/lib/python3.7/site-packages/pyAudioAnalysis/audioTrainTest.py", line 1014, in fileClassification curFV = (mt_features - MEAN) / STD # normalization ValueError: operands could not be broadcast together with shapes (136,) (68,)

This issue goes away when I roll back to an earlier commit (3ba17f66a2314c49512f2d47a968620eb4c3f33c)

mdinescu commented 4 years ago

Can confirm that this happens when attempting to run the classifyFolder or segmentClassifyFile with current tip of master (https://github.com/tyiannak/pyAudioAnalysis/commit/bacb14f719e7bc039947059fefb35505c52a4cff)

Looks like the current feature vector is different than what was used to train the stored models. Tried both knn and svm