isseu/emotion-recognition-neural-networks

Error when running cvs_to_numpy.py

Opened this issue · 2 comments

I am using an Ubuntu 16.04 Docker with python 3.5. Also tried it with python 3.6.

Traceback (most recent call last):
  File "/home/admin/emotion/emotion-recognition-neural-networks/lib/python3.5/site-packages/pandas/core/indexes/base.py", line 2566, in get_value
    return libts.get_value_box(s, key)
  File "pandas/_libs/tslib.pyx", line 1017, in pandas._libs.tslib.get_value_box
  File "pandas/_libs/tslib.pyx", line 1025, in pandas._libs.tslib.get_value_box
TypeError: 'str' object cannot be interpreted as an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "cvs_to_numpy.py", line 76, in <module>
    emotion = emotion_to_vec(row['emotion'])
  File "/home/admin/emotion/emotion-recognition-neural-networks/lib/python3.5/site-packages/pandas/core/series.py", line 623, in __getitem__
    result = self.index.get_value(self, key)
  File "/home/admin/emotion/emotion-recognition-neural-networks/lib/python3.5/site-packages/pandas/core/indexes/base.py", line 2574, in get_value
    raise e1
  File "/home/admin/emotion/emotion-recognition-neural-networks/lib/python3.5/site-packages/pandas/core/indexes/base.py", line 2560, in get_value
    tz=getattr(series.dtype, 'tz', None))
  File "pandas/_libs/index.pyx", line 83, in pandas._libs.index.IndexEngine.get_value
  File "pandas/_libs/index.pyx", line 91, in pandas._libs.index.IndexEngine.get_value
  File "pandas/_libs/index.pyx", line 139, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 1265, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 1273, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'emotion'
jotga commented

Hi, I have the same problem. Any ideas?

I have just had the problem also, and the problem seems to be in the dataset. I think there should be a column with emotion which can't be found which is the cause of the keyError on line 76. You can just open the csv and rename the first column to 'emotion', hope this might help