pyAudioAnalysis icon indicating copy to clipboard operation
pyAudioAnalysis copied to clipboard

Result, P, classNames returning (-1,-1,-1)

Open vansydy opened this issue 6 years ago • 3 comments

Training worked perfectly, and the results from training evaluation were perfect. When trying to classify a single file or folder I receive type errors (receiving integer, expecting list for enumerate) upon further debugging I discovered the cause is

Result, P, classNames

are all being returned as -1, with no error message. I even went as far as adding additional console logs to audioTrainTest, but still receiving no reason for the return of -1.

Audio clips are less than 1 second long, WAV format, 8000Hhz Sample Rate. They trained fine, and the directories are being read fine. Same error on both Linux and Windows.

vansydy avatar Jun 04 '19 06:06 vansydy

(-1, -1, -1) Class Probability Traceback (most recent call last): File "audioAnalysis.py", line 578, in classifyFileWrapper(args.input, args.model, args.classifier) File "audioAnalysis.py", line 107, in classifyFileWrapper for i, c in enumerate(classNames): TypeError: 'int' object is not iterable

vansydy avatar Jun 04 '19 06:06 vansydy

I got the same (-1, -1, -1) output. Any thoughts?

paddygoat avatar Oct 04 '19 13:10 paddygoat

if isinstance(x, int):                                 # audio file IO problem
    return (-1, -1, -1)
if x.shape[0] / float(Fs) <= mt_win:
    return (-1, -1, -1)

My audio file was too short.

paddygoat avatar Oct 04 '19 14:10 paddygoat