audio icon indicating copy to clipboard operation
audio copied to clipboard

Interactive ASR demo not working

Open nellorebhanuteja opened this issue 4 years ago • 2 comments

🐛 Describe the bug

Hi I am trying to run the interactive ASR demo given here. However I am getting the following error

Traceback (most recent call last):
  File "/data1/miniconda3/envs/fairseq/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/data1/miniconda3/envs/fairseq/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/data0/wav2vec_pytorch/audio/examples/interactive_asr/asr.py", line 47, in <module>
    cli_main()
  File "/data0/wav2vec_pytorch/audio/examples/interactive_asr/asr.py", line 40, in cli_main
    parser = options.get_generation_parser()
  File "/data0/wav2vec_pytorch/audio/examples/interactive_asr/fairseq/fairseq/options.py", line 49, in get_generation_parser
    parser = get_parser("Generation", default_task)
  File "/data0/wav2vec_pytorch/audio/examples/interactive_asr/fairseq/fairseq/options.py", line 227, in get_parser
    utils.import_user_module(usr_args)
  File "/data0/wav2vec_pytorch/audio/examples/interactive_asr/fairseq/fairseq/utils.py", line 495, in import_user_module
    import_tasks(tasks_path, f"{module_name}.tasks")
  File "/data0/wav2vec_pytorch/audio/examples/interactive_asr/fairseq/fairseq/tasks/__init__.py", line 117, in import_tasks
    importlib.import_module(namespace + "." + task_name)
  File "/data1/miniconda3/envs/fairseq/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 843, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/data0/wav2vec_pytorch/audio/examples/interactive_asr/fairseq/examples/speech_recognition/tasks/speech_recognition.py", line 69, in <module>
    class SpeechRecognitionTask(LegacyFairseqTask):
  File "/data0/wav2vec_pytorch/audio/examples/interactive_asr/fairseq/fairseq/tasks/__init__.py", line 71, in register_task_cls
    raise ValueError("Cannot register duplicate task ({})".format(name))
ValueError: Cannot register duplicate task (speech_recognition)

nellorebhanuteja avatar Oct 20 '21 10:10 nellorebhanuteja

Hi @nellorebhanuteja

This example is from early stage of the project and is no longer maintained, and we do not expect it to work.

From the error, I think it is because the fairseq version is too new. You probably need to checkout the version of fairseq from around August 2019, and possibly downgrade PyTorch/torchaudio as well.

mthrok avatar Oct 20 '21 13:10 mthrok

Oh There's another interactive decoding example in fairseq as well. I'll try and reply.

nellorebhanuteja avatar Oct 21 '21 02:10 nellorebhanuteja