HHTseng / video-classification

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

unseen labels #18

Open nicholasguimaraes opened 4 years ago

nicholasguimaraes commented 4 years ago

I'm trying to start training on UCF101 dataset just as your tutorial shows but I'm getting the follwing error.

Traceback (most recent call last): File "UCF101_ResNetCRNN.py", line 168, in all_y_list = labels2cat(le, actions) # all video labels File "C:\Users\Windows\Documents\video-classification-master\ResNetCRNN\functions.py", line 14, in labels2cat return labelencoder.transform(list) File "C:\Users\Windows\AppData\Roaming\Python\Python36\site-packages\sklearn\preprocessing\label.py", line 257, in transform , y = encode(y, uniques=self.classes, encode=True) File "C:\Users\Windows\AppData\Roaming\Python\Python36\site-packages\sklearn\preprocessing\label.py", line 110, in _encode return _encode_numpy(values, uniques, encode) File "C:\Users\Windows\AppData\Roaming\Python\Python36\site-packages\sklearn\preprocessing\label.py", line 53, in _encode_numpy % str(diff)) ValueError: y contains previously unseen labels: ['ableTennisSho', 'abyCrawlin', 'aftin', 'aiCh', 'aircu', 'alanceBea', 'alkingWithDo', 'allPushup', 'alsaSpi', 'ammerThro', 'ammerin', 'andMarchin', 'andstandPushup', 'andstandWalkin', 'arallelBar', 'aseballPitc', 'asketbal', 'asketballDun', 'avelinThro', 'ayakin', 'ceDancin', 'eadMassag', 'enchPres', 'encin', 'ennisSwin', 'havingBear', 'hotpu', 'hrowDiscu', 'ieldHockeyPenalt', 'ighJum', 'ikin', 'ilitaryParad', 'illiard', 'ivin', 'ixin', 'izzaTossin', 'kateBoardin', 'kiin', 'kije', 'kyDivin', 'layingCell', 'layingDa', 'layingDho', 'layingFlut', 'layingGuita', 'layingPian', 'layingSita', 'layingTabl', 'layingVioli', 'leanAndJer', 'liffDivin', 'loorGymnastic', 'lowDryHai', 'lowingCandle', 'nevenBar', 'nittin', 'oY', 'occerJugglin', 'occerPenalt', 'ockClimbingIndoo', 'odyWeightSquat', 'oleVaul', 'olfSwin', 'olleyballSpikin', 'ommelHors', 'ongJum', 'opeClimbin', 'oppingFloo', 'orseRac', 'orseRidin', 'owin', 'owlin', 'oxingPunchingBa', 'oxingSpeedBa', 'pplyEyeMakeu', 'pplyLipstic', 'rampolineJumpin', 'rcher', 'reastStrok', 'ricketBowlin', 'ricketSho', 'risbeeCatc', 'ritingOnBoar', 'rontCraw', 'rummin', 'rushingTeet', 'tillRing', 'ugglingBall', 'ulaHoo', 'ullUp', 'umoWrestlin', 'umpRop', 'umpingJac', 'unc', 'unchuck', 'unge', 'urfin', 'ushUp', 'uttingInKitche', 'win', 'ypin']

For some odd reason it seems to be chopping some letters from the labels list.

Do you know what could be done?

mampferd commented 4 years ago

Check the code in File "UCF101_ResNetCRNN.py", line 168

It should be: allnames = [] for f in fnames: loc1 = f.find('v') loc2 = f.find('_g') actions.append(f[(loc1 + 2): loc2])

all_names.append(f)

If this the same code in your case, you could try actions.append(f[(loc1 + 1): loc2 + 1]) Maybe your environment causes the f.find() command to output another value than the line before the argument occurs. I don't know

yeqiyuan commented 4 years ago

I'm trying to start training on UCF101 dataset just as your tutorial shows but I'm getting the follwing error.

Traceback (most recent call last): File "UCF101_ResNetCRNN.py", line 168, in all_y_list = labels2cat(le, actions) # all video labels File "C:\Users\Windows\Documents\video-classification-master\ResNetCRNN\functions.py", line 14, in labels2cat return labelencoder.transform(list) File "C:\Users\Windows\AppData\Roaming\Python\Python36\site-packages\sklearn\preprocessing\label.py", line 257, in transform , y = encode(y, uniques=self.classes, encode=True) File "C:\Users\Windows\AppData\Roaming\Python\Python36\site-packages\sklearn\preprocessing\label.py", line 110, in _encode return _encode_numpy(values, uniques, encode) File "C:\Users\Windows\AppData\Roaming\Python\Python36\site-packages\sklearn\preprocessing\label.py", line 53, in _encode_numpy % str(diff)) ValueError: y contains previously unseen labels: ['ableTennisSho', 'abyCrawlin', 'aftin', 'aiCh', 'aircu', 'alanceBea', 'alkingWithDo', 'allPushup', 'alsaSpi', 'ammerThro', 'ammerin', 'andMarchin', 'andstandPushup', 'andstandWalkin', 'arallelBar', 'aseballPitc', 'asketbal', 'asketballDun', 'avelinThro', 'ayakin', 'ceDancin', 'eadMassag', 'enchPres', 'encin', 'ennisSwin', 'havingBear', 'hotpu', 'hrowDiscu', 'ieldHockeyPenalt', 'ighJum', 'ikin', 'ilitaryParad', 'illiard', 'ivin', 'ixin', 'izzaTossin', 'kateBoardin', 'kiin', 'kije', 'kyDivin', 'layingCell', 'layingDa', 'layingDho', 'layingFlut', 'layingGuita', 'layingPian', 'layingSita', 'layingTabl', 'layingVioli', 'leanAndJer', 'liffDivin', 'loorGymnastic', 'lowDryHai', 'lowingCandle', 'nevenBar', 'nittin', 'oY', 'occerJugglin', 'occerPenalt', 'ockClimbingIndoo', 'odyWeightSquat', 'oleVaul', 'olfSwin', 'olleyballSpikin', 'ommelHors', 'ongJum', 'opeClimbin', 'oppingFloo', 'orseRac', 'orseRidin', 'owin', 'owlin', 'oxingPunchingBa', 'oxingSpeedBa', 'pplyEyeMakeu', 'pplyLipstic', 'rampolineJumpin', 'rcher', 'reastStrok', 'ricketBowlin', 'ricketSho', 'risbeeCatc', 'ritingOnBoar', 'rontCraw', 'rummin', 'rushingTeet', 'tillRing', 'ugglingBall', 'ulaHoo', 'ullUp', 'umoWrestlin', 'umpRop', 'umpingJac', 'unc', 'unchuck', 'unge', 'urfin', 'ushUp', 'uttingInKitche', 'win', 'ypin']

For some odd reason it seems to be chopping some letters from the labels list.

Do you know what could be done?

Hello, did you figure out this problem? I had the same question.

yeqiyuan commented 3 years ago

Hello, I just used code like that, It should be: allnames = [] for f in fnames: loc1 = f.find('v') loc2 = f.find('_g') actions.append(f[(loc1 + 2): loc2])

The result is y contains previously unseen labels: ['DS_Stor'], how to deal with that, thank you for your help.

yeqiyuan commented 3 years ago

Hello, I just used code like that, It should be: allnames = [] for f in fnames: loc1 = f.find('v') loc2 = f.find('_g') actions.append(f[(loc1 + 2): loc2])

The result is y contains previously unseen labels: ['DS_Stor'], how to deal with that, thank you for your help.

Under gpu, it shows unseen labels , ['pegs_25']