HHTseng / video-classification

Tutorial for video classification/ action recognition using 3D CNN/ CNN+RNN on UCF101
940 stars 216 forks source link

train mistake #21

Open chenyang9799 opened 4 years ago

chenyang9799 commented 4 years ago

Happy Chinese New Year! There was a mistake in training:

File "UCF101_CRNN.py", line 173, in <module>
    all_y_list = labels2cat(le, actions)    # all video labels
  File "/data/chenyang/video_classification/video-classification/CRNN/functions.py", line 14, in labels2cat
    return label_encoder.transform(list)
  File "/usr/local/anaconda3/lib/python3.7/site-packages/sklearn/preprocessing/label.py", line 134, in transform
    return np.searchsorted(self.classes_, y)
  File "/usr/local/anaconda3/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 1170, in searchsorted
    return _wrapfunc(a, 'searchsorted', v, side=side, sorter=sorter)
  File "/usr/local/anaconda3/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 61, in _wrapfunc
    return _wrapit(obj, method, *args, **kwds)
  File "/usr/local/anaconda3/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 41, in _wrapit
    result = getattr(asarray(obj), method)(*args, **kwds)
TypeError: Cannot cast array data from dtype('float64') to dtype('<U32') according to the rule 'safe'

Can you help me?Thanks.

HHTseng commented 4 years ago

Happy new year! Thanks for the error message. May I ask what versions are your packages running? eg. numpy, pandas, scikit-learn, pytorch?