raymin0223 / patch-mix_contrastive_learning

Patch-Mix Contrastive Learning with Audio Spectrogram Transformer on Respiratory Sound Classification (INTERSPEECH 2023)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

format issue

JianGang-Li opened this issue · comments

I attempted to run the. sh file (using bash./scripts/icbhi_patchmix_cl. sh), but reported an error:

Traceback (most recent call last):
File "main.py", line 545, in
main()
File "main.py", line 487, in main
train_loader, val_loader, args = set_loader(args)
File "main.py", line 214, in set_loader
train_dataset = ICBHIDataset(train_flag=True, transform=train_transform, args=args, print_flag=True)
File "/work/msy/ICBHI_patch_mix_AST/patch-mix_contrastive_learning-main/util/icbhi_dataset.py", line 66, in init
self.file_to_device[f.strip().split('.')[0]] = self.device_to_id[device]
KeyError: 'format'

May I ask what modifications should I make? The dataset is already in the specified location in the data folder.

Hi @JianGang-Li, sorry for the late response.

I believe that this error is from the wrong path of ICBHI dataset.
In my data path, actual wav files are stored in a different folder (audio_test_data) than data description files, such as filename_format.txt.

Can you check if data files are stored like the following structure?

image

I'm closing this issue, but feel free to reopen it if you have further questions.

I'm sorry but I was wrong for the reason of this bug.
I found that we should delete filename_differences.txt, filename_format.txt, and script.sh from the folder, after unzipping the ICBHI dataset.