satojkovic / DeepTrafficSign

Traffic sign recognition with Deep Convolutional Neural Networks
20 stars 3 forks source link

Unable to re-create setup #1

Open watbywbarif opened 2 years ago

watbywbarif commented 2 years ago

Original links for setup on http://benchmark.ini.rub.de are not working, I found files with same name on sid.erda.dk/public/archives but I am unable to run any commands after: python3 gen_pickle.py fails after few minutes with error below (Ubuntu 21.04 + Python 3.9.5 + pandas-1.3.4 + tensorflow 2.7.0 - please specify if some older version of sw should be used):

Traceback (most recent call last):
  File "/home/tester/.local/lib/python3.9/site-packages/pandas/core/indexes/base.py", line 3361, in get_loc
    return self._engine.get_loc(casted_key)
  File "pandas/_libs/index.pyx", line 76, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 108, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 5198, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 5206, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'ClassId'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/mnt/c/Temp/2021/speed_limit_ai/test-3rd-party/DeepTrafficSign/gen_pickle.py", line 229, in <module>
    main()
  File "/mnt/c/Temp/2021/speed_limit_ai/test-3rd-party/DeepTrafficSign/gen_pickle.py", line 195, in main
    test_bboxes, test_classIds = parse_gt_csv(test_gt_csvs, common.TEST_SIZE)
  File "/mnt/c/Temp/2021/speed_limit_ai/test-3rd-party/DeepTrafficSign/gen_pickle.py", line 70, in parse_gt_csv
    for i, (img_file_path, bbox,
  File "/mnt/c/Temp/2021/speed_limit_ai/test-3rd-party/DeepTrafficSign/gen_pickle.py", line 52, in gt_csv_getline
    classId = df.loc[i, 'ClassId']
  File "/home/tester/.local/lib/python3.9/site-packages/pandas/core/indexing.py", line 925, in __getitem__
    return self._getitem_tuple(key)
  File "/home/tester/.local/lib/python3.9/site-packages/pandas/core/indexing.py", line 1100, in _getitem_tuple
    return self._getitem_lowerdim(tup)
  File "/home/tester/.local/lib/python3.9/site-packages/pandas/core/indexing.py", line 862, in _getitem_lowerdim
    return getattr(section, self.name)[new_key]
  File "/home/tester/.local/lib/python3.9/site-packages/pandas/core/indexing.py", line 931, in __getitem__
    return self._getitem_axis(maybe_callable, axis=axis)
  File "/home/tester/.local/lib/python3.9/site-packages/pandas/core/indexing.py", line 1164, in _getitem_axis
    return self._get_label(key, axis=axis)
  File "/home/tester/.local/lib/python3.9/site-packages/pandas/core/indexing.py", line 1113, in _get_label
    return self.obj.xs(label, axis=axis)
  File "/home/tester/.local/lib/python3.9/site-packages/pandas/core/generic.py", line 3776, in xs
    loc = index.get_loc(key)
  File "/home/tester/.local/lib/python3.9/site-packages/pandas/core/indexes/base.py", line 3363, in get_loc
    raise KeyError(key) from err
KeyError: 'ClassId'
satojkovic commented 2 years ago

@watbywbarif Sorry for late response.

According to the error, it looks like the file format is not correct. Is GT-final_test.csv in the following format? The last column should be 'ClassId'.

$ head GT-final_test.csv
Filename;Width;Height;Roi.X1;Roi.Y1;Roi.X2;Roi.Y2;ClassId
00000.ppm;53;54;6;5;48;49;16
00001.ppm;42;45;5;5;36;40;1
00002.ppm;48;52;6;6;43;47;38
00003.ppm;27;29;5;5;22;24;33
00004.ppm;60;57;5;5;55;52;11
00005.ppm;52;56;5;5;47;51;38
00006.ppm;147;130;12;12;135;119;18
00007.ppm;32;33;5;5;26;28;12
00008.ppm;45;50;6;5;40;45;25
schaefi commented 1 year ago

I stumbled over the same issue. The problem is that in the dataset there is also a file GTSRB/Final_Test/Images/GT-final_test.test.csv which does not set the ;ClassId column. The code is reading all .csv files and when it comes to this one it fails.

As there is also a correct GT-final_test.csv in the dataset I deleted the other one which fixed it for me