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

bugs in utils/egogesture_json.py #83

Open
cuge1995 opened this issue Aug 2, 2020 · 3 comments
Open

bugs in utils/egogesture_json.py #83

cuge1995 opened this issue Aug 2, 2020 · 3 comments

Comments

@cuge1995
Copy link

cuge1995 commented Aug 2, 2020

'DataFrame' object has no attribute 'ix'

@cuge1995
Copy link
Author

cuge1995 commented Aug 4, 2020

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

@ghost
Copy link

ghost commented Aug 5, 2020

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.

@Prashant2717
Copy link

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>

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