Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minibatch package error #7

Closed
schko opened this issue Jun 16, 2021 · 1 comment
Closed

minibatch package error #7

schko opened this issue Jun 16, 2021 · 1 comment

Comments

@schko
Copy link

schko commented Jun 16, 2021

Thanks for your work in implementing video bert! I was receiving the following error when playing around with the code, training on a set of 300 videos with a batch size of 12:

Traceback (most recent call last):
File "VideoBERT/VideoBERT/I3D/minibatch_hkmeans.py", line 30, in
main()
File "VideoBERT/VideoBERT/I3D/minibatch_hkmeans.py", line 26, in main
hkmeans(root, prefix, 4, 12, batch_size, 15, save_dir, 'vecs', centroid_dir)
File "/opt/conda/envs/videobert/lib/python3.7/site-packages/hkmeans_minibatch-1.0.2-py3.7.egg/hkmeans_minibatch/hkmeans.py", line 99, in hkmeans
hkmeans_recursive(root, prefix, h, k, batch_size, epochs, save_dir, save_prefix, centroid_dir)
File "/opt/conda/envs/videobert/lib/python3.7/site-packages/hkmeans_minibatch-1.0.2-py3.7.egg/hkmeans_minibatch/hkmeans.py", line 91, in hkmeans_recursive
save_prefix.format(i), centroid_dir, cur_h=cur_h + 1)
File "/opt/conda/envs/videobert/lib/python3.7/site-packages/hkmeans_minibatch-1.0.2-py3.7.egg/hkmeans_minibatch/hkmeans.py", line 87, in hkmeans_recursive
save_sorted_vectors(centroids, labelled_data, batch_size, save_dir, save_prefix)
File "/opt/conda/envs/videobert/lib/python3.7/site-packages/hkmeans_minibatch-1.0.2-py3.7.egg/hkmeans_minibatch/hkmeans.py", line 56, in save_sorted_vectors
sorted_vecs.append(np.expand_dims(vectors[j], axis=0))
IndexError: index 12 is out of bounds for axis 0 with size 12

Is this an issue with dataset size?

@schko schko changed the title minibatch code error minibatch package error Jun 16, 2021
@schko
Copy link
Author

schko commented Jun 17, 2021

I think this is solved, it had to do with the batch size being a multiple of 20, and deleting my kmeans folder from past runs.

@schko schko closed this as completed Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant