emotion-recognition-neural-networks icon indicating copy to clipboard operation
emotion-recognition-neural-networks copied to clipboard

Error when running cvs_to_numpy.py

Open svenschultze opened this issue 6 years ago • 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'

svenschultze avatar May 21 '18 11:05 svenschultze

Hi, I have the same problem. Any ideas?

jotga avatar Jun 08 '18 10:06 jotga

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

wswapped avatar Jun 24 '18 23:06 wswapped