imatge-upc / activitynet-2016-cvprw

Tools to participate in the ActivityNet Challenge 2016 (NIPSW 2016)

Home Page:https://imatge-upc.github.io/activitynet-2016-cvprw/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error running create_stateful_dataset.py

fitrialif opened this issue · comments

(venv)ubuntu@ubuntu-S2600CW:~/Desktop/yc/activitynet-2016-cvprw-master$ python scripts/create_stateful_dataset.py
Number of videos for training subset: 38
Number of batches: 0
Creating stateful dataset for training subset
0% ( 0 of 256) | | Elapsed Time: 0:00:00 ETA: --:--:--Traceback (most recent call last):
File "scripts/create_stateful_dataset.py", line 138, in
args.subset
File "scripts/create_stateful_dataset.py", line 89, in create_stateful_dataset
output[video_index] = to_categorical(output_classes, nb_classes=output_size)
File "/home/ubuntu/Desktop/yc/activitynet-2016-cvprw-master/scripts/src/data.py", line 30, in to_categorical
Y[i, y[i]] = 1.
IndexError: only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices

(This is the error i get after run create_stateful_dataset.py with the dataset downloaded from youtube. Then i try to troubleshoot it and i found the problem is from data.py as i get "None" for variable output:

for start_frame in start_frames:
    # Obtain the label for this isntance and then its output
    output = None

    outs = outputs[start_frame:start_frame+length]
    if outs.count(label) >= length / 2:
        output = labels.index(label)
    else:
        output = labels[0] <----------------------it will jump to this everytime i run create_stateful_dataset.py
    instances.append(output)

Try to update the code to the latest version, I think previous people commented this issue and it has been fixed.

@albertomontesg @fitrialif I also meet this error when i running the create_stateful_dataset.py,my error is assert nb_instances == len(output_classes), i have update the code to the latest version

@albertomontesg What is the contents of the notebooks?