tyiannak / color_your_music_mood

A realtime demo for generating colors based on musical moods
MIT License
44 stars 8 forks source link

when I try to run your code , there is something wrong , do you know why? #1

Closed wy192 closed 3 years ago

wy192 commented 4 years ago

AttributeError Traceback (most recent call last)

in 1 [clf_energy, mu_energy, std_energy, class_names_energy,mt_win_en, mt_step_en, st_win_en, st_step_en, _] = aT.load_model("energy") 2 fv_2 = (f_2[:, 0] - mu_energy) / std_energy ----> 3 [res_energy, p_en] = aT.classifier_wrapper(clf_energy, "svm_rbf", fv_2) 4 # win_class_energy = class_names_energy[int(res_energy)] /data/miniconda2_python2.7/envs/py36_wy/lib/python3.6/site-packages/pyAudioAnalysis/audioTrainTest.py in classifier_wrapper(classifier, classifier_type, test_sample) 90 - model: regression model 91 - model_type: "svm" or "knn" (TODO) ---> 92 - test_sample: a feature vector (numpy array) 93 RETURNS: 94 - R: regression result (estimated value) /data/miniconda2_python2.7/envs/py36_wy/lib/python3.6/site-packages/sklearn/svm/_base.py in predict(self, X) 583 """ 584 check_is_fitted(self) --> 585 if self.break_ties and self.decision_function_shape == 'ovo': 586 raise ValueError("break_ties must be False when " 587 "decision_function_shape is 'ovo'") AttributeError: 'SVC' object has no attribute 'break_ties'
tyiannak commented 4 years ago

That's probably an issue with the scikit-learn version of pyAudioAnalysis. Please install pyAudioAnalysis according to instructions.

GFLEMING133 commented 3 years ago

Hi there. I installed pyAudioAnalysis per the instructions (using pip3) and I still have this issue. [Edit]: I got it to work on a raspberry pi 3 B+ by doing some sketchy things that I didn't document well. Now I"m trying to get this working on a barebones Ubuntu 20.04 machine, and don't want to repeat the terrible things I did to make it work on my pi.

@tyiannak, I think publishing versions of the model that were trained using a newer version of scikit-learn should fix everything, though. Any chance you can train/post those? Or provide info/commands on how you trained your initial model?

Thank you so much for your work on this library, II know this is probably just something you do with your free time and are under no obligation to help. That said, I really appreciate any help you can provide.

Source:

https://stackoverflow.com/questions/29773574/python-error-in-svm-classifier-predict

tyiannak commented 3 years ago

Thanx for the comment I've pushed models trained under scikit-learn 0.23.2 Also updated the requirements file to make this a clear dependency. It should work now

GFLEMING133 commented 3 years ago

It now works perfectly. Thank you SO much!