Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

training csv files and extracted features doesnt match? #21

Open
Noumanijaz744 opened this issue Sep 13, 2022 · 32 comments
Open

training csv files and extracted features doesnt match? #21

Noumanijaz744 opened this issue Sep 13, 2022 · 32 comments

Comments

@Noumanijaz744
Copy link

Hi i am trying to run your codes i have successfully extracted the feature by using 3class Dcase 2020 datasets through script "extr_feat_2020_nodelta_scaled.py" after i run the command "python train_fcnn.py " the below error occur please help me to resolve this .
2022-09-13 18:33:39.709410: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x55f9c6bffc90 executing computations on platform CUDA. Devices:
2022-09-13 18:33:39.709454: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0): GeForce GTX 1080 Ti, Compute Capability 6.1
Traceback (most recent call last):
File "/data/nouman/Task1_lcasc/DCASE2020_task1-master/DCASE2020_task1-master/task1a/3class/fcnn/train_fcnn.py", line 61, in
data_val, y_val = load_data_2020(feat_path, val_csv, num_freq_bin, 'logmel')
File "/data/nouman/Task1_lcasc/DCASE2020_task1-master/DCASE2020_task1-master/task1a/3class/fcnn/utils.py", line 27, in load_data_2020
with open(filepath,'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/data/nouman/Task1_lcasc/DCASE2020_task1-master/DCASE2020_task1-master/task1a/3class/features/logmel128_scaled/airport-paris-206-6247-b.logmel'

@MihawkHu
Copy link
Owner

Hi,

When u extracted log-mel feature files, please make sure u included all the files that u want to use for training and testing in the csv file. https://github.com/MihawkHu/DCASE2020_task1/blob/master/task1a/3class/extr_feat_2020_nodelta_scaled.py#L12

Besides, the data set might be changed so some old audio files might have been removed. #16 (comment)

@MihawkHu
Copy link
Owner

I just checked the file u mentioned, logmel128_scaled/airport-paris-206-6247-b.logmel, which is the first audio of the evaluation set. So I think u may try to change the csv file name in https://github.com/MihawkHu/DCASE2020_task1/blob/master/task1a/3class/extr_feat_2020_nodelta_scaled.py#L12, to point to https://github.com/MihawkHu/DCASE2020_task1/blob/master/task1a/3class/evaluation_setup/fold1_evaluate_3class.csv. And then run the script extr_feat_2020_nodelta_scaled.py again. Thus the acoustic features for the evaluation set will be extracted.

@Noumanijaz744
Copy link
Author

i am following the task from the basic i open https://github.com/MihawkHu/DCASE2020_task1/tree/master/task1a/3class extracted feature by using script [extr_feat_2020_nodelta_scaled.py] by giving path to DCASE 2020 3class dataset file_path='nouman/datasets/d20/TAU-urban-acoustic-scene-2020-3class-development/'
csv_file='nouman/datasets/d20/TAU-urban-acoustic-scene-2020-3class-development/meta.csv'
i have'nt downloaded 10class TAU-urban-acoustic-scene-development dataset yet.

@Noumanijaz744
Copy link
Author

the most confusing thing is that the TAUTAU-urban-acoustic-scene-2020-3class-development dataset only contain audio from Device A but the https://github.com/MihawkHu/DCASE2020_task1/tree/master/task1a/3class/evaluation_setup csv files contain data from other devices also .
please have a comprehensive guide from your side will really able me to implement this task

@Noumanijaz744
Copy link
Author

for this task first i have to download 'TAU-urban-acoustic-scene-2020-3class-development' dataset and 'TAU-urban-acoustic-scene-2020-10class-development' dataset and unzip these two in one file that is 'data/dcase_audio/'.
am i right?
or
its ok to have features of one datasets 'TAU-urban-acoustic-scene-2020-3class-developmen' and trained FCNN ?

@Noumanijaz744
Copy link
Author

Noumanijaz744 commented Sep 19, 2022

i dont know have to create fold1_all.csv .it should be created manually ?

@MihawkHu
Copy link
Owner

I guess now I understand what's the problem. There are two sub-tasks of 2020 task1. Task 1a is referred to the 10-class data set, whereas task 1b is referred to the 3-class data set. You can go to the official website of DCASE for more details https://dcase.community/challenge2020/index, where task 1a focuses on device robustness, thus the dataset includes audios from different devices. Task 1b focuses on model complexity.

The folder u mentioned here, https://github.com/MihawkHu/DCASE2020_task1/tree/master/task1a/, includes our system for task 1a. Here the 3 class and 10 class is our proposed two-stage system, which u can refer to our ICASSP paper for more details. https://arxiv.org/abs/2011.01447. It does not mean the final target is to do the 3-class classification, that is in task 1b. So the csv file u used here, it's from the task 1b data set, thus there are some differences. Please use the 10-class data set, as the csv and all others can match.

@Noumanijaz744
Copy link
Author

the task 1a also two subtask 3class and 10class and then we have fusion of those two. so please have a look on the csv files . how arrange the paths of csv files in my experiments .in 3class data their is only one device that is device A but their train csv contain files from devices

@Noumanijaz744
Copy link
Author

github
1.the above highlighted line the "data/dcase/audio" contain dataset of both the 3class and 10class TAU-Urban-acoustic-scene-development for training 3class/FCNN ?
2.fold1_all.csv file is not available here in the directory .how to create the fold1_all.csv?
your highness can help me alot please if you can describe about the csv files creation .
3. 'features/logmel128_scaled' contain the log-mel features of both the 3class and 10class datasets?

@MihawkHu
Copy link
Owner

Hi,

For task 1a, the 3-class and 10-class share the same data, where the only difference is the labels. I checked the 3-class data csv file. Both the training, https://github.com/MihawkHu/DCASE2020_task1/blob/master/task1a/3class/evaluation_setup/fold1_train_3class.csv, and the testing, https://github.com/MihawkHu/DCASE2020_task1/blob/master/task1a/3class/evaluation_setup/fold1_evaluate_3class.csv, have all the devices. Please point me out if I misunderstood anything.

For your questions,
1), Yes u can do feature extraction for 3-class and 10-class at one time, cuz they share the same audio contents and the only difference is the labels.
2), U can refer to the overall csv files in 10-class https://github.com/MihawkHu/DCASE2020_task1/blob/master/task1a/10class/evaluation_setup/fold1_train_all.csv, in 3-class, https://github.com/MihawkHu/DCASE2020_task1/blob/master/task1a/3class/evaluation_setup/fold1_train_all_3class.csv, They both means the so-called 'fold1_all.csv'. However, please note that they also contain the augmented audio names, where u can refer to the data augmentation part for more details, https://github.com/MihawkHu/DCASE2020_task1/tree/master/task1a/data_augmentation. So u can see these two files contain a lot of extra data.
I suppose that u are going to go through the pipeline at first, so u can now skip the data augmentation part for simplicity. So just simply concatenate the training csv in https://github.com/MihawkHu/DCASE2020_task1/blob/master/task1a/3class/evaluation_setup/fold1_train_3class.csv in and the evaluation csv in https://github.com/MihawkHu/DCASE2020_task1/blob/master/task1a/3class/evaluation_setup/fold1_evaluate_3class.csv to get 'fold1_all.csv',
3). Yes u r right, as the 1) mentioned.

@Noumanijaz744
Copy link
Author

thanks alot for the reply
i mean first i have to extract features on the base of meta.csv file available with both of the 10 and 3-class datasets?
https://github.com/MihawkHu/DCASE2020_task1/blob/master/task1a/3class/extr_feat_2020_nodelta_scaled.py#L12
meta.csv
meta.csv
or
we dont need to deal with this meta files ?
we need to combine both the audio files of datasets in one folder that is dcase_audio?

@Noumanijaz744
Copy link
Author

after concatenating https://github.com/MihawkHu/DCASE2020_task1/blob/master/task1a/3class/evaluation_setup/fold1_train_3class.csv and https://github.com/MihawkHu/DCASE2020_task1/blob/master/task1a/3class/evaluation_setup/fold1_evaluate_3class.csv to get fold1_all.csv i am getting another error which is given file name error.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/data/nouman/Task1_lcasc/DCASE2020_task1-master/DCASE2020_task1-master/task1a/3class/extr_feat_2020_nodelta_scaled.py", line 28, in
wavpath = data_df['filename'].tolist()
File "/data/nouman/.conda/envs/d20-keras/lib/python3.6/site-packages/pandas/core/frame.py", line 2800, in getitem
indexer = self.columns.get_loc(key)
File "/data/nouman/.conda/envs/d20-keras/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2648, in get_loc
return self._engine.get_loc(self._maybe_cast_indexer(key))
File "pandas/_libs/index.pyx", line 111, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1618, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1626, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'filename'

@MihawkHu
Copy link
Owner

Hi, u may need to remove the header of the second csv.

@Noumanijaz744
Copy link
Author

by concatenating i got this fold1_all.csv
Uploading fold1_all.csv…

@Noumanijaz744
Copy link
Author

by concatenating i got this fold1_all.csv
fold1_all.csv

@MihawkHu
Copy link
Owner

MihawkHu commented Sep 20, 2022

If u did in this way, you may need to remove line 16937: "filename scene_label".

You can find more information about NumPy and Pandas at https://numpy.org/doc/ and https://pandas.pydata.org/docs/index.html.

@Noumanijaz744
Copy link
Author

dear sir i have read you technical report and tried every way to reproduce results and run this code but unfortunately i didn't succeeded. can you please give me a short overview from the start to get implement this code .please point out the csv files if its not in directory upload it here
i believe your highness help me alot and you will help me more to get the results of this code.

@MihawkHu
Copy link
Owner

Hi, I will definitely help you with your problems and questions. Please let me know if the previous solution can solve your problem.

@Noumanijaz744
Copy link
Author

i am trying now to mix both the 3 and 10-class development dataset but for the feature extraction which file shoiuld i use because the fold1_alll is giving the error of filename?
please upload the fold1_all.csv file here so that i know what's the problem in my experiment?

@MihawkHu
Copy link
Owner

If u did in this way, you may need to remove line 16937: "filename scene_label".

You can find more information about NumPy and Pandas at https://numpy.org/doc/ and https://pandas.pydata.org/docs/index.html.

Did you try this? I'm not with my PC now so I can not help you to generate it.

If you feel difficult to handle csv or pandas, please try to set the 'csv_file' at https://github.com/MihawkHu/DCASE2020_task1/blob/master/task1a/3class/extr_feat_2020_nodelta_scaled.py#L12 to 'evaluation_setup/fold1_evaluate_3class.csv' and 'evaluation_setup/fold1_train_3class.csv', then run them respectively.

The script here, https://github.com/MihawkHu/DCASE2020_task1/blob/master/task1a/3class/extr_feat_2020_nodelta_scaled.py, is to extract and save acoustic features, so indicate any file list you want to use ('csv' file) then you can get extracted features.

In our paper, we described that we used different setups (with/without different data augmentation strategies) so here in the codes, we did not indicate a specific csv file to avoid confusion. You can use any csv file that you want to have for training and testing in your experiments. For your case, I would suggest you skip the data augmentation part at the first step for simplicity. So you can just extract features for the training and testing set which is suggested by the original data set. Please try the solutions I mentioned here.

Besides, please note that 10 class and 3 class classifiers used the same audio data, the only difference is the labels. So you don't need to extract features twice for them.

@Noumanijaz744
Copy link
Author

you mean one 10-class datatset is enough to extract features from ?

@MihawkHu
Copy link
Owner

Yes, for task 1a, the 3-class and 10-class share the same data, where the only difference is the labels.

@Noumanijaz744
Copy link
Author

i think i did mistake i extract features from the original 3-class dataset based on their original meta.csv file which involves only device A datasets .
Uploading meta.csv…

@Noumanijaz744
Copy link
Author

the three class csv contain the labels as indoor ,outdoor and transportation so how can i extract features from 10-class audio files based on 3-class csv labels ?

@MihawkHu
Copy link
Owner

MihawkHu commented Sep 20, 2022

Yes, for task 1a, the 3-class and 10-class share the same data, where the only difference is the labels. You dont need to extract 10-class acoustic features again cuz they are the same. You can refer to our paper for more details about our proposed procedure. https://arxiv.org/abs/2011.01447

@Noumanijaz744
Copy link
Author

but whenever we are extracting the features the audio files name and their labels in csv should the same to extract features accordingly. i mean we cant extract the features through the csv files included in the evaluation setup for 3-class ...am i right?

@MihawkHu
Copy link
Owner

The 3-class data set you mentioned before is for task 1b of DCASE 2020, it has only device A data and the target point is the model complexity. As for task 1a, the goal is to do the device-robust 10 class classification. You can find more information about the two tasks here, https://dcase.community/challenge2020/task-acoustic-scene-classification#subtask-a.

We proposed a two-stage system for task 1a, as described in our paper, https://arxiv.org/abs/2011.01447. You can surely use our task1a code to build a system for task 1b dataset (the 3-class data set on the official website, only device A), just change the corresponding csv file and paths.

@Noumanijaz744
Copy link
Author

first i want to implement task1a please clear me and upload the csv files used in the subtask1a

@MihawkHu
Copy link
Owner

If u did in this way, you may need to remove line 16937: "filename scene_label".
You can find more information about NumPy and Pandas at https://numpy.org/doc/ and https://pandas.pydata.org/docs/index.html.

Did you try this? I'm not with my PC now so I can not help you to generate it.

If you feel difficult to handle csv or pandas, please try to set the 'csv_file' at https://github.com/MihawkHu/DCASE2020_task1/blob/master/task1a/3class/extr_feat_2020_nodelta_scaled.py#L12 to 'evaluation_setup/fold1_evaluate_3class.csv' and 'evaluation_setup/fold1_train_3class.csv', then run them respectively.

The script here, https://github.com/MihawkHu/DCASE2020_task1/blob/master/task1a/3class/extr_feat_2020_nodelta_scaled.py, is to extract and save acoustic features, so indicate any file list you want to use ('csv' file) then you can get extracted features.

In our paper, we described that we used different setups (with/without different data augmentation strategies) so here in the codes, we did not indicate a specific csv file to avoid confusion. You can use any csv file that you want to have for training and testing in your experiments. For your case, I would suggest you skip the data augmentation part at the first step for simplicity. So you can just extract features for the training and testing set which is suggested by the original data set. Please try the solutions I mentioned here.

Besides, please note that 10 class and 3 class classifiers used the same audio data, the only difference is the labels. So you don't need to extract features twice for them.

Did you try this?

@Noumanijaz744
Copy link
Author

the main thing is the feature extraction csv that is "fold1_all.csv" is not available anywhere in this gitub directory when you get please upload it

@MihawkHu
Copy link
Owner

If u did in this way, you may need to remove line 16937: "filename scene_label".
You can find more information about NumPy and Pandas at https://numpy.org/doc/ and https://pandas.pydata.org/docs/index.html.

Did you try this? I'm not with my PC now so I can not help you to generate it.
If you feel difficult to handle csv or pandas, please try to set the 'csv_file' at https://github.com/MihawkHu/DCASE2020_task1/blob/master/task1a/3class/extr_feat_2020_nodelta_scaled.py#L12 to 'evaluation_setup/fold1_evaluate_3class.csv' and 'evaluation_setup/fold1_train_3class.csv', then run them respectively.
The script here, https://github.com/MihawkHu/DCASE2020_task1/blob/master/task1a/3class/extr_feat_2020_nodelta_scaled.py, is to extract and save acoustic features, so indicate any file list you want to use ('csv' file) then you can get extracted features.
In our paper, we described that we used different setups (with/without different data augmentation strategies) so here in the codes, we did not indicate a specific csv file to avoid confusion. You can use any csv file that you want to have for training and testing in your experiments. For your case, I would suggest you skip the data augmentation part at the first step for simplicity. So you can just extract features for the training and testing set which is suggested by the original data set. Please try the solutions I mentioned here.
Besides, please note that 10 class and 3 class classifiers used the same audio data, the only difference is the labels. So you don't need to extract features twice for them.

Did you try this?

Hi, did you read my sentences here?

"
The script here, https://github.com/MihawkHu/DCASE2020_task1/blob/master/task1a/3class/extr_feat_2020_nodelta_scaled.py, is to extract and save acoustic features, so indicate any file list you want to use ('csv' file) then you can get extracted features.

In our paper, we described that we used different setups (with/without different data augmentation strategies) so here in the codes, we did not indicate a specific csv file to avoid confusion. You can use any csv file that you want to have for training and testing in your experiments. For your case, I would suggest you skip the data augmentation part at the first step for simplicity. So you can just extract features for the training and testing set which is suggested by the original data set. Please try the solutions I mentioned here.
"

You may generate your fold1_all.csv by simply concatenating https://github.com/MihawkHu/DCASE2020_task1/blob/master/task1a/3class/evaluation_setup/fold1_train_3class.csv and https://github.com/MihawkHu/DCASE2020_task1/blob/master/task1a/3class/evaluation_setup/fold1_evaluate_3class.csv. I think you did this before but you need to remove the header of the second file (the first line), otherwise the pandas read csv function would not work (see my answers above). Alternatively, you can run this script for training and testing, respectively.

@Noumanijaz744
Copy link
Author

thank you much its so late here in my area i am trying and will inform you if their occur in problem again ..i am really grateful to you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants