DCASE-REPO / DESED_task

Domestic environment sound event detection task
MIT License
126 stars 67 forks source link

KeyError: Caught KeyError in DataLoader worker process 0. #91

Closed ylee1123 closed 6 months ago

ylee1123 commented 6 months ago

I keep getting this error when I try to run train_pretrained.py

I thought I might have problems on the dataset, but the error still pops up even after I redownload the dataset.

KeyError: Caught KeyError in DataLoader worker process 0. Original Traceback (most recent call last): File "/home/user/.conda/envs/dcase2024/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop data = fetcher.fetch(index) File "/home/user/.conda/envs/dcase2024/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 51, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/user/.conda/envs/dcase2024/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 51, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/user/.conda/envs/dcase2024/lib/python3.8/site-packages/torch/utils/data/dataset.py", line 335, in getitem return self.datasets[dataset_idx][sample_idx] File "/mnt/hdd_8TB/SED/DESED_task/recipes/dcase2024_task4_baseline/desed_task/dataio/datasets.py", line 216, in getitem index = self.ex2emb_idx[name] KeyError: 'metro_station_07-007300-008300'

fschmid56 commented 6 months ago

Hi, have you extracted the BEATs embeddings with the following command?

python extract_embeddings.py --output_dir "./embeddings"

ylee1123 commented 6 months ago

@fschmid56 I did, but the error popped up. I solved it by re-downloading the dataset and re-extract the BEATs embeddings.

Thank you for your help.