-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
model.predict dropping 1 label #1
Comments
Note: I'm now passing in 41 classes and am getting 41 results. model = train(features, labels, num_classes = len(np.unique(labels)), epochs = 500) |
Ah, I think it's here. Doing np.max takes ignores zero and gives you off by one errors. This would fix it len(np.unique(labels). I can submit a PR if you agree? @98mprice |
Also, Why are you subtracting by 1 here? https://github.com/98mprice/pyAudioClassification/blob/master/pyaudioclassification/__init__.py#L42 |
Hi @ryanbales Good find! I think you're probably right about this being the cause of the off-by-one error. To be honest, I can't remember exactly why I subtracted 1 there but it may have been because I copied the code from some of my other projects and didn't pay attention when I did so. Unfortunately I'm currently unable to test whether removing that -1 will fix the issue, but please feel free to submit a PR regardless and I'll marge it and deploy the new release to PyPi when I get home. Thanks! |
@ryanbales Did the fix work? ValueError: Error when checking target: expected activation_5 to have shape (2,) but got array with shape (1,) The error is raised here: File "test.py", line 36, in Please let me know if I am doing something wrong over here. |
@raifofcl Did you find any solution for your error ? I got exactly the same. |
@lpnaunau I cant say it to be a solution, but I found a workaround. I put an empty folder in the data folder.
|
@raifofcl Thanks ! |
I am also getting same errors. model = train(features, labels, epochs=100, print_summary=True) Even though i changed in format of still i am getting errors. |
@raifofcl I tried your solution but still getting the same issue. |
@ignvinay Is all that folder contains .ogg or .wav files. It supports for those file formats only. |
@ryanbales I am doing like what you suggested and got the error as File "test.py", line 25, in |
I'm training a model using the freesound data from Kaggle: https://www.kaggle.com/c/freesound-audio-tagging/data
I'm training with 41 classes, but am only getting 40 results. I'm following the basic code from Readme.
The text was updated successfully, but these errors were encountered: