pyannote / pyannote-audio

Neural building blocks for speaker diarization: speech activity detection, speaker change detection, overlapped speech detection, speaker embedding
http://pyannote.github.io
MIT License
6.38k stars 784 forks source link

Error occurs following training tutorial #1678

Closed LVCSRer closed 7 months ago

LVCSRer commented 7 months ago

Tested versions

Reproducible in 3.1.1

System information

Windows 11, pyannote-audio 3.1.1, i7-10700, GeForce RTX 2070 Super

Issue description

When I follow the training tutorial below error occur in trainer.fit(vad_model) stage.

c:\Users\Minseok Keum.conda\envs\pyannote\Lib\site-packages\pyannote\audio\core\io.py:43: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call. torchaudio.set_audio_backend("soundfile") 'AMI.SpeakerDiarization.mini' found in C:\Users\Minseok Keum\Desktop\pyannote_train\AMI-diarization-setup\pyannote\database.yml does not define the 'scope' of speaker labels (file, database, or global). Setting it to 'file'. Protocol AMI.SpeakerDiarization.mini does not provide the path to audio files: adding an 'audio' preprocessor for you. See pyannote.database documentation on how to do that yourself. Protocol AMI.SpeakerDiarization.mini does not precompute the output of torchaudio.info(): adding a 'torchaudio.info' preprocessor for you to speed up dataloaders. See pyannote.database documentation on how to do that yourself. Backend TkAgg is interactive backend. Turning interactive mode on. GPU available: False, used: False TPU available: False, using: 0 TPU cores IPU available: False, using: 0 IPUs HPU available: False, using: 0 HPUs

| Name | Type | Params | In sizes | Out sizes 0 | sincnet | SincNet | 42.6 K | [1, 1, 32000] | [1, 60, 115] 1 | lstm | LSTM | 589 K | [1, 115, 60] | [[1, 115, 256], [[4, 1, 128], [4, 1, 128]]] 2 | linear | ModuleList | 49.4 K | ? | ? 3 | classifier | Linear | 129 | [1, 115, 128] | [1, 115, 1] 4 | activation | Sigmoid | 0 | [1, 115, 1] | [1, 115, 1] 0 Non-trainable params 681 K Total params 2.728 Total estimated model params size (MB) Sanity Checking: | | 0/? [00:00<?, ?it/s]0.01s - Debugger warning: It seems that frozen modules are being used, which may 0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off 0.00s - to python to disable frozen modules. 0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation. c:\Users\Minseok Keum.conda\envs\pyannote\Lib\site-packages\pyannote\audio\core\io.py:43: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call. torchaudio.set_audio_backend("soundfile") 'AMI.SpeakerDiarization.mini' found in C:\Users\Minseok Keum\Desktop\pyannote_train\AMI-diarization-setup\pyannote\database.yml does not define the 'scope' of speaker labels (file, database, or global). Setting it to 'file'. Protocol AMI.SpeakerDiarization.mini does not provide the path to audio files: adding an 'audio' preprocessor for you. See pyannote.database documentation on how to do that yourself. Protocol AMI.SpeakerDiarization.mini does not precompute the output of torchaudio.info(): adding a 'torchaudio.info' preprocessor for you to speed up dataloaders. See pyannote.database documentation on how to do that yourself. Backend TkAgg is interactive backend. Turning interactive mode on. Traceback (most recent call last): File "c:\Users\Minseok Keum.conda\envs\pyannote\Lib\runpy.py", line 198, in _run_module_as_main return _run_code(code, main_globals, None, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Users\Minseok Keum.conda\envs\pyannote\Lib\runpy.py", line 88, in _run_code exec(code, run_globals) File "c:\Users\Minseok Keum.vscode\extensions\ms-python.debugpy-2024.2.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher/../..\debugpy__main.py", line 39, in cli.main() File "c:\Users\Minseok Keum.vscode\extensions\ms-python.debugpy-2024.2.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 430, in main run() File "c:\Users\Minseok Keum.vscode\extensions\ms-python.debugpy-2024.2.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 284, in run_file
runpy.run_path(target, run_name="main") File "c:\Users\Minseok Keum.vscode\extensions\ms-python.debugpy-2024.2.0-win32-x64\bundled\libs\debugpy_vendored\pydevd_pydevd_bundle\pydevd_runpy.py", line 321, in run_path return _run_module_code(code, init_globals, run_name, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Users\Minseok Keum.vscode\extensions\ms-python.debugpy-2024.2.0-win32-x64\bundled\libs\debugpy_vendored\pydevd_pydevd_bundle\pydevd_runpy.py", line 135, in _run_module_code _run_code(code, mod_globals, init_globals, File "c:\Users\Minseok Keum.vscode\extensions\ms-python.debugpy-2024.2.0-win32-x64\bundled\libs\debugpy_vendored\pydevd_pydevd_bundle\pydevd_runpy.py", line 124, in _run_code exec(code, run_globals) File "C:\Users\Minseok Keum\Desktop\pyannote_train\train.py", line 20, in File "c:\Users\Minseok Keum.conda\envs\pyannote\Lib\site-packages\pytorch_lightning\trainer\trainer.py", line 544, in fit call._call_and_handle_interrupt( File "c:\Users\Minseok Keum.conda\envs\pyannote\Lib\site-packages\pytorch_lightning\trainer\call.py", line 44, in _call_and_handle_interrupt return trainer_fn(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Users\Minseok Keum.conda\envs\pyannote\Lib\site-packages\pytorch_lightning\trainer\trainer.py", line 580, in _fit_impl self._run(model, ckpt_path=ckpt_path) File "c:\Users\Minseok Keum.conda\envs\pyannote\Lib\site-packages\pytorch_lightning\trainer\trainer.py", line 987, in _run results = self._run_stage() ^^^^^^^^^^^^^^^^^ File "c:\Users\Minseok Keum.conda\envs\pyannote\Lib\site-packages\pytorch_lightning\trainer\trainer.py", line 1031, in _run_stage self._run_sanity_check() File "c:\Users\Minseok Keum.conda\envs\pyannote\Lib\site-packages\pytorch_lightning\trainer\trainer.py", line 1060, in _run_sanity_check val_loop.run() File "c:\Users\Minseok Keum.conda\envs\pyannote\Lib\site-packages\pytorch_lightning\loops\utilities.py", line 182, in _decorator return loop_run(self, args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Users\Minseok Keum.conda\envs\pyannote\Lib\site-packages\pytorch_lightning\loops\evaluation_loop.py", line 113, in run self.reset() File "c:\Users\Minseok Keum.conda\envs\pyannote\Lib\site-packages\pytorch_lightning\loops\evaluation_loop.py", line 231, in reset iter(data_fetcher) # creates the iterator inside the fetcher ^^^^^^^^^^^^^^^^^^ File "c:\Users\Minseok Keum.conda\envs\pyannote\Lib\site-packages\pytorch_lightning\loops\fetchers.py", line 104, in iter super().iter() File "c:\Users\Minseok Keum.conda\envs\pyannote\Lib\site-packages\pytorch_lightning\loops\fetchers.py", line 51, in
iter self.iterator = iter(self.combined_loader) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Users\Minseok Keum.conda\envs\pyannote\Lib\site-packages\pytorch_lightning\utilities\combined_loader.py", line 351, in iter iter(iterator) File "c:\Users\Minseok Keum.conda\envs\pyannote\Lib\site-packages\pytorch_lightning\utilities\combined_loader.py", line 155, in iter self._load_current_iterator() File "c:\Users\Minseok Keum.conda\envs\pyannote\Lib\site-packages\pytorch_lightning\utilities\combined_loader.py", line 173, in _load_current_iterator self.iterators = [iter(self.iterables[self._iterator_idx])] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Users\Minseok Keum.conda\envs\pyannote\Lib\site-packages\torch\utils\data\dataloader.py", line 439, in iter return self._get_iterator() ^^^^^^^^^^^^^^^^^^^^ File "c:\Users\Minseok Keum.conda\envs\pyannote\Lib\site-packages\torch\utils\data\dataloader.py", line 387, in _get_iterator return _MultiProcessingDataLoaderIter(self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Users\Minseok Keum.conda\envs\pyannote\Lib\site-packages\torch\utils\data\dataloader.py", line 1040, in init w.start() File "c:\Users\Minseok Keum.conda\envs\pyannote\Lib\multiprocessing\process.py", line 121, in start self._popen = self._Popen(self) ^^^^^^^^^^^^^^^^^ File "c:\Users\Minseok Keum.conda\envs\pyannote\Lib\multiprocessing\context.py", line 224, in _Popen return _default_context.get_context().Process._Popen(process_obj) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Users\Minseok Keum.conda\envs\pyannote\Lib\multiprocessing\context.py", line 336, in _Popen return Popen(process_obj) ^^^^^^^^^^^^^^^^^^ File "c:\Users\Minseok Keum.conda\envs\pyannote\Lib\multiprocessing\popen_spawn_win32.py", line 94, in init__ reduction.dump(process_obj, to_child) File "c:\Users\Minseok Keum.conda\envs\pyannote\Lib\multiprocessing\reduction.py", line 60, in dump ForkingPickler(file, protocol).dump(obj) _pickle.PicklingError: Can't pickle <class 'pyannote.database.registry.AMI'>: attribute lookup AMI on pyannote.database.registry failed

And I just tried colab setting to find if there is setting difference, but error occurs at earlier stage.

image

Minimal reproduction example (MRE)

from pyannote.database import registry, FileFinder from pyannote.audio.tasks import VoiceActivityDetection from pyannote.audio.models.segmentation import PyanNet import pytorch_lightning as pl

registry.load_database("AMI-diarization-setup/pyannote/database.yml")
ami = registry.get_protocol('AMI.SpeakerDiarization.mini')
vad_task = VoiceActivityDetection(ami, duration=2.0, batch_size=128) vad_model = PyanNet(task=vad_task, sincnet={'stride': 10})
trainer = pl.Trainer(devices=1, max_epochs=1) trainer.fit(vad_model)

LVCSRer commented 7 months ago

Oh. It works on WSL!