KeyError: "word '---e1gyo84' not in vocabulary"
Sorry to bother you, but I have encountered the following problem:
python3 main.py --n_epochs 150 --bs 22 --lr 1e-3 --network c3d --dataset kinetics2both --save_path /home/m/Desktop/ZeroShotVideoClassification-master/result --nopretrainedTotal batch size: 22
UCF101: total number of videos 13320, classes 101
HMDB51: total number of videos 6766, classes 51
Traceback (most recent call last):
File "main.py", line 66, in
I look forward to your reply. Thank you very much
It might be a little bit late for you @ML201809, but if there is anyone who encountered this, this answer might helpful.
You should change here like this:
def get_kinetics(dataset=''):
sourcepath = '/path/to/kinetics400'
n_classes = '700' if '700' in dataset else '400'
with open('/path/to/kinetics400/annotations/train.csv', 'r') as f:
data = [r[:-1].split(',') for r in f.readlines()]
fnames, labels = [], []
for x in data[1:]:
if len(x) < 2: continue
fnames.append(os.path.join(sourcepath, x[4], x[0], x[1] + ".mp4"))
labels.append(x[0])
classes = sorted(np.unique(labels).tolist())
return fnames, labels, classes
where train.csv is
label,youtube_id,time_start,time_end,split
testifying,---QUuC4vJs,84,94,train
eating spaghetti,--3ouPhoy2A,20,30,train
dribbling basketball,--4-0ihtnBU,58,68,train
playing tennis,--56QUhyDQM,185,195,train
tap dancing,--6q_33gNew,132,142,train
climbing a rope,--EaS9P7ZdQ,13,23,train
brushing teeth,--IPbe5ZMCI,2,12,train
balloon blowing,--Ntf6n-j9Q,17,27,train
feeding birds,--PyMoD3_eg,20,30,train
...