DigitalPhonetics / speaker-anonymization

Speaker anonymization pipeline for hiding the identity of the speaker of a recording by changing the voice in it.
GNU General Public License v3.0
50 stars 4 forks source link

No such file or directory: 'pretrained_models' #2

Open RMobina opened 1 year ago

RMobina commented 1 year ago

Hi, I see the following error while running "run_inference.py". I would be appriciated for any advice.

Model type of anonymizer: gan Loading a multilingual model, which is strange for this purpose. Please double check that the correct model is being loaded. 1/9: Processing libri_test_trials_f... Anonymize speaker embeddings... Load original speaker embeddings... [nltk_data] Downloading package averaged_perceptron_tagger to [nltk_data] /root/nltk_data... [nltk_data] Unzipping taggers/averaged_perceptron_tagger.zip. [nltk_data] Downloading package cmudict to /root/nltk_data... [nltk_data] Unzipping corpora/cmudict.zip. /usr/local/lib/python3.8/dist-packages/espnet_model_zoo/downloader.py:217: UserWarning: Expanding a local model to the cachedir. If you'll move the file to another path, it's treated as a different model. warnings.warn( /usr/local/lib/python3.8/dist-packages/torch/hub.py:286: UserWarning: You are about to download and run code from an untrusted repository. In a future release, this won't be allowed. To add the repository to your trusted list, change the command to {calling_fn}(..., trust_repo=False) and a command prompt will appear asking for an explicit confirmation of trust, or load(..., trust_repo=True), which will assume that the prompt is to be answered with 'yes'. You can also use load(..., trust_repo='check') which will only prompt for confirmation if the repo is not already trusted. This will eventually be the default behaviour warnings.warn( Downloading: "https://github.com/snakers4/silero-vad/zipball/master" to /root/.cache/torch/hub/master.zip Traceback (most recent call last): File "run_inference.py", line 125, in <module> anon_wav_scps = run_pipeline(device=device, settings=settings, datasets=datasets, dirs=dirs) File "run_inference.py", line 61, in run_pipeline anon_embeddings, new_anon = anonymizer.anonymize_embeddings(dataset=dataset) File "speaker-anonymization/inference/anonymization.py", line 41, in anonymize_embeddings anon_embeddings = self.anonymizer.anonymize_data(self.data_dir / dataset, File "/speaker-anonymization/anonymization/gan_anonymizer.py", line 61, in anonymize_data speaker_embeddings = self._get_speaker_embeddings(data_dir, vector_dir / f'{emb_level}_level_{self.vec_type}', File "/speaker-anonymization/anonymization/base_anonymizer.py", line 52, in _get_speaker_embeddings vectors.extract_vectors_from_audio(data_dir=data_dir) File "/speaker-anonymization/anonymization/speaker_embeddings.py", line 57, in extract_vectors_from_audio self._extract_style_embeddings_from_audio(data_dir=data_dir, model_path=model_path) File "/speaker-anonymization/anonymization/speaker_embeddings.py", line 233, in _extract_style_embeddings_from_audio check_dict = torch.load(model_path, map_location='cpu') File "/usr/local/lib/python3.8/dist-packages/torch/serialization.py", line 791, in load with _open_file_like(f, 'rb') as opened_file: File "/usr/local/lib/python3.8/dist-packages/torch/serialization.py", line 271, in _open_file_like return _open_file(name_or_buffer, mode) File "/usr/local/lib/python3.8/dist-packages/torch/serialization.py", line 252, in __init__ super().__init__(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: 'pretrained_models'

SarinaMeyer commented 1 year ago

Hi, Thanks for the information, this was actually a bug. It should be fixed now. Could you run the code again and try if it works now?