Real-time-GesRec icon indicating copy to clipboard operation
Real-time-GesRec copied to clipboard

bugs in utils/egogesture_json.py

Open cuge1995 opened this issue 4 years ago • 3 comments

'DataFrame' object has no attribute 'ix'

cuge1995 avatar Aug 02 '20 01:08 cuge1995

File "utils/egogesture_json.py", line 86, in <module>
    val_csv_path, dst_json_path)
  File "utils/egogesture_json.py", line 53, in convert_egogesture_csv_to_activitynet_json
    train_database = convert_csv_to_dict(train_csv_path, 'training', labels)
  File "utils/egogesture_json.py", line 9, in convert_csv_to_dict
    data = pd.read_csv(csv_path, delimiter=' ', header=None)
  File "/home/cuge/anaconda3/envs/gesture/lib/python3.6/site-packages/pandas/io/parsers.py", line 685, in parser_f
    return _read(filepath_or_buffer, kwds)
  File "/home/cuge/anaconda3/envs/gesture/lib/python3.6/site-packages/pandas/io/parsers.py", line 463, in _read
    data = parser.read(nrows)
  File "/home/cuge/anaconda3/envs/gesture/lib/python3.6/site-packages/pandas/io/parsers.py", line 1154, in read
    ret = self._engine.read(nrows)
  File "/home/cuge/anaconda3/envs/gesture/lib/python3.6/site-packages/pandas/io/parsers.py", line 2059, in read
    data = self._reader.read(nrows)
  File "pandas/_libs/parsers.pyx", line 881, in pandas._libs.parsers.TextReader.read
  File "pandas/_libs/parsers.pyx", line 896, in pandas._libs.parsers.TextReader._read_low_memory
  File "pandas/_libs/parsers.pyx", line 950, in pandas._libs.parsers.TextReader._read_rows
  File "pandas/_libs/parsers.pyx", line 937, in pandas._libs.parsers.TextReader._tokenize_rows
  File "pandas/_libs/parsers.pyx", line 2132, in pandas._libs.parsers.raise_parser_error
pandas.errors.ParserError: Error tokenizing data. C error: Expected 4 fields in line 287, saw 5

cuge1995 avatar Aug 04 '20 02:08 cuge1995

1st problem:

  • You can change all 'ix' to 'loc'.

2nd problem:

  • There were some problems with egoGesture annotation file. You go to "trainlistall.txt" (or any file you generated when run the annotation code).
  • Check the line "287" (according to your error). You will see some error line: "Subject03\Scene2\Color\rgb7 nan nan"
  • Follow the data path to "labels-final-revised1" in the egoGesture dataset. In this case: "labels-final-revised1\Subject03\Scene2".
  • You will see some .csv file.
  • Open and check all, you will see some abnormal sign like "" at the end of the file. Remove it.
  • Run the annotation code again.

ghost avatar Aug 05 '20 06:08 ghost

Hello @cuge1995,

were you able to run this code? thanks @ghost for fixing this issue but still I'm not able to run the main.py file.

=it gives me error as follows:

Traceback (most recent call last): File "C:\Users\PRASH\Project_3D_design\Real-time-GesRec-master\main.py", line 98, in train_loader = torch.utils.data.DataLoader( File "C:\Users\PRASH\anaconda3\envs\user_interface\lib\site-packages\torch\utils\data\dataloader.py", line 351, in init sampler = RandomSampler(dataset, generator=generator) # type: ignore[arg-type] File "C:\Users\PRASH\anaconda3\envs\user_interface\lib\site-packages\torch\utils\data\sampler.py", line 107, in init raise ValueError("num_samples should be a positive integer " ValueError: num_samples should be a positive integer value, but got num_samples=0

(user_interface) C:\Users\PRASH\Project_3D_design\Real-time-GesRec-master>

Prashant2717 avatar Jun 06 '23 20:06 Prashant2717