Skip to content
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

Error with change detection #43

Closed
nikopartanen opened this issue Jul 25, 2017 · 2 comments
Closed

Error with change detection #43

nikopartanen opened this issue Jul 25, 2017 · 2 comments

Comments

@nikopartanen
Copy link

I went through the Speech Activity Detection tutorial succesfully, and the resulting test mdtm files look good in what it comes to basic segmentation, but there are some problems with Change Detection tutorial.

I get the same error now when I try evaluate and apply commands:

Using Theano backend.
Traceback (most recent call last):
  File "/Users/niko/anaconda3/envs/pyannote/bin/pyannote-change-detection", line 11, in <module>
    load_entry_point('pyannote.audio', 'console_scripts', 'pyannote-change-detection')()
  File "/Users/niko/pyannote_test/pyannote-audio/pyannote/audio/applications/change_detection.py", line 392, in main
    epoch=epoch, min_duration=min_duration)
  File "/Users/niko/pyannote_test/pyannote-audio/pyannote/audio/applications/change_detection.py", line 268, in evaluate
    predictions[uri] = aggregation.apply(dev_file)
  File "/Users/niko/pyannote_test/pyannote-audio/pyannote/audio/labeling/aggregation.py", line 120, in apply
    predictions = next(self.from_file(current_file))
  File "/Users/niko/anaconda3/envs/pyannote/lib/python3.5/site-packages/pyannote/generators/batch.py", line 365, in from_file
    incomplete=incomplete):
  File "/Users/niko/anaconda3/envs/pyannote/lib/python3.5/site-packages/pyannote/generators/batch.py", line 418, in __call__
    for fragment in self.generator.from_file(preprocessed_file):
  File "/Users/niko/anaconda3/envs/pyannote/lib/python3.5/site-packages/pyannote/generators/fragment.py", line 148, in from_file
    wav = current_file['wav']
KeyError: 'wav'

Thanks for help!

@yinruiqing
Copy link
Contributor

Hi,
From line 361--366 in pyannote-audio/pyannote/audio/applications/change_detection.py

    preprocessors = {'wav': FileFinder(db_yml)}

    if '<database.task.protocol>' in arguments:
        protocol_name = arguments['<database.task.protocol>']
        protocol = get_protocol(protocol_name, progress=True,
            preprocessors=preprocessors)

will add the wav file path to current_file['wav']. Could you please print the current_file to verify if the wav path has been passed successfully.

@nikopartanen
Copy link
Author

I assume the error was connected to the changes in a recent commit and the different versions I had installed. I installed the newest development versions of both pyannote-audio and pyannote-core, and now it works, but I had to change the first line you refer to into 'wav' from current 'audio'. Before that it didn't work but gave the error I copied above, now it only gives a warning "wav" key is deprecated in favor of "audio" but seems to work fine. Thanks for help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants