DCASE-REPO / dcase2018_baseline

DCASE 2018 Baseline systems
MIT License
128 stars 78 forks source link

When I run the task1a.py, there is an error reported. #9

Closed dby124 closed 6 years ago

dby124 commented 6 years ago

When I run the task1a.py, there is an error reported as following:

[I] Testing [I] ======================================== [I] Fold [1] [I] DONE [0:00:00.017001] [I] [I] Evaluation [I] ======================================== [E] MetaDataContainer: Unknown row format [['LIST', 'STRING']], row [['D:/学习/DCASE挑战赛相关资料/DCASE', '2018/dcase2018_baseline/task1/datasets/TUT-urban-acoustic-scenes-2018-development/audio/airport-barcelona-203-6122-a.wav\tairport']] (metadata.py:1415) NoneType: None MetaDataContainer: Unknown row format [['LIST', 'STRING']], row [['D:/学习/DCASE挑战赛相关资料/DCASE', '2018/dcase2018_baseline/task1/datasets/TUT-urban-acoustic-scenes-2018-development/audio/airport-barcelona-203-6122-a.wav\tairport']]

There seems exist an error when read audio/airport-barcelona-203-6122-a.wav\tairport.

toni-heittola commented 6 years ago

I suspect the problem is because you have a whitespace in your path "DCASE挑战赛相关资料/DCASE 2018". Try removing the whitespace or replacing that it with underscore. Meanwhile I will see how to update the system to be more robust for this use case.

toni-heittola commented 6 years ago

Try if commit f696043765c3a576575364ed9c840a5770b69680 fixed this issue.

dby124 commented 6 years ago

After I updated the code and deleted the whitespace, another error reported as following:

[I] Evaluation [I] ======================================== Traceback (most recent call last): File "D:/学习/DCASE挑战赛相关资料/DCASE_2018/dcase2018_baseline/task1/task1a_1.py", line 1161, in sys.exit(main(sys.argv)) File "D:/学习/DCASE挑战赛相关资料/DCASE_2018/dcase2018_baseline/task1/task1a_1.py", line 263, in main application_mode=application_mode File "D:/学习/DCASE挑战赛相关资料/DCASE_2018/dcase2018_baseline/task1/task1a_1.py", line 1028, in do_evaluation estimated_scene_list[item_id]['filename'] = os.path.split(item.filename)[-1] File "C:\Users\beatrice\AppData\Local\Programs\Python\Python36\lib\ntpath.py", line 205, in split p = os.fspath(p) TypeError: expected str, bytes or os.PathLike object, not NoneType

dby124 commented 6 years ago

In 1028 code line of the function named do_evaluation, I tried to print the item information like the following:

    for item_id, item in enumerate(estimated_scene_list):
        print("输出待分割文件名:", item_id, item.filename)
        # print("输出分割后文件名:", os.path.split(item.filename))
        # estimated_scene_list[item_id]['filename'] = os.path.split(item.filename)[-1]
        # estimated_scene_list[item_id]['file'] = item.filename

Then the result was shown as following:

输出待分割文件名: 0 D:/学习/DCASE挑战赛相关资料/DCASE_2018/dcase2018_baseline/task1/datasets/TUT-urban-acoustic-scenes-2018-development/audio/airport-barcelona-203-6122-a.wav 输出待分割文件名: 1 None 输出待分割文件名: 2 D:/学习/DCASE挑战赛相关资料/DCASE_2018/dcase2018_baseline/task1/datasets/TUT-urban-acoustic-scenes-2018-development/audio/airport-barcelona-203-6123-a.wav 输出待分割文件名: 3 None 输出待分割文件名: 4 D:/学习/DCASE挑战赛相关资料/DCASE_2018/dcase2018_baseline/task1/datasets/TUT-urban-acoustic-scenes-2018-development/audio/airport-barcelona-203-6124-a.wav 输出待分割文件名: 5 None 输出待分割文件名: 6 D:/学习/DCASE挑战赛相关资料/DCASE_2018/dcase2018_baseline/task1/datasets/TUT-urban-acoustic-scenes-2018-development/audio/airport-barcelona-203-6125-a.wav .......

Maybe there some problem in the loop.

dby124 commented 6 years ago

In 1028 code line of the function named do_evaluation, I tried to print the item information like the following:

    print(type(estimated_scene_list))
    print(estimated_scene_list)
    for item_id, item in enumerate(estimated_scene_list):
        print(item_id)
        # estimated_scene_list[item_id]['filename'] = os.path.split(item.filename)[-1]
        # estimated_scene_list[item_id]['file'] = item.filename

Then the result was shown as following: <class 'dcase_util.containers.metadata.MetaDataContainer'> MetaDataContainer :: Class Filename : D:\学习\DCASE挑战赛相关资料\DCASE_2018\dcase2018_baseline\task1\system\task1a\recognizer\46f887e4a2427de3106f\7c08a3edb431ddfa3e1f\f7937d1167990f25fb2f\res_fold_1.txt Items : 5036 Unique Files : 2518 Scene labels : 10 Event labels : 0 Tags : 0 Identifiers : 0 Source labels : 0

Meta data Source Onset Offset Scene Event Tags Identifier


    D:/学习/DCASE挑战赛相关资料..        -        -   airport           -                 -                 -       
    -                           -        -   -                 -                 -                 -       
    D:/学习/DCASE挑战赛相关资料..        -        -   airport           -                 -                 -       
    -                           -        -   -                 -                 -                 -       
    D:/学习/DCASE挑战赛相关资料..        -        -   airport           -                 -                 -       
    -                           -        -   -                 -                 -                 -       
    D:/学习/DCASE挑战赛相关资料..        -        -   airport           -                 -                 -       
    -                           -        -   -                 -                 -                 -       
    D:/学习/DCASE挑战赛相关资料..        -        -   airport           -                 -                 -       
    -                           -        -   -                 -                 -                 -       
    D:/学习/DCASE挑战赛相关资料..        -        -   airport           -                 -                 -       
    -                           -        -   -                 -                 -                 -       
    D:/学习/DCASE挑战赛相关资料..        -        -   airport           -                 -                 -       
    -                           -        -   -                 -                 -                 -       
    D:/学习/DCASE挑战赛相关资料..        -        -   airport           -                 -                 -       
    -                           -        -   -                 -                 -                 -       
    D:/学习/DCASE挑战赛相关资料..        -        -   airport           -                 -                 -       
dby124 commented 6 years ago

finally, I changed 1019 code line of the function named do_evaluation like the following:

    estimated_scene_list = dcase_util.containers.MetaDataContainer().load(
        filename=fold_results_filename,
        # file_format=dcase_util.utils.FileFormat.CSV,
        # fields=['filename', 'scene_label'],
        # csv_header=False,
        # delimiter='\t'
    )

Then the result is true. [I] Evaluation [I] ======================================== [I] [I] Scene | Accuracy
[I] ----------------- | ----------------------
[I] airport | 55.8%
[I] bus | 63.2%
[I] metro | 42.9%
[I] metro_station | 61.0%
[I] park | 78.9%
[I] public_square | 42.1%
[I] shopping_mall | 49.1%
[I] street_pedestrian | 42.9%
[I] street_traffic | 81.7%
[I] tram | 52.5%
[I] ----------------- | ----------------------
[I] Average | 57.0%
[I] [I] DONE [0:00:01.955004]

toni-heittola commented 6 years ago

This issue was closed as the problem was solved by the user. Feel free to reopen issue if needed.