facebookresearch / faiss

A library for efficient similarity search and clustering of dense vectors.
https://faiss.ai
MIT License
30.57k stars 3.56k forks source link

NotImplementedError: Wrong number or type of arguments for overloaded function 'Clustering_train' #2069

Closed SharangKaul123 closed 2 years ago

SharangKaul123 commented 2 years ago

Summary

Platform

OS: Ubuntu 18.04 LTS

Faiss version: faiss-gpu 1.6.3

Installed from: Installed from ananconda (conda 4.10.3)

Faiss compilation options:

Running on:

Interface:

Reproduction instructions

Hey Everyone, I tried the first command for clustering before the training part: python3 main.py --mode=cluster --arch=vgg16 --pooling=netvlad --num_clusters=64 And then it throws me the following error while computing the 'main.py' file from the repository: Namespace(arch='vgg16', batchSize=4, cacheBatchSize=24, cachePath='/tmp/', cacheRefreshRate=1000, ckpt='latest', dataPath='/home/kau4hi/slam_ws/src/pytorch-NetVlad/netvlad_v100_datasets/data/', dataset='pittsburgh', evalEvery=1, fromscratch=False, lr=0.0001, lrGamma=0.5, lrStep=5, margin=0.1, mode='cluster', momentum=0.9, nEpochs=30, nGPU=1, nocuda=False, num_clusters=64, optim='SGD', patience=10, pooling='netvlad', resume='', runsPath='/home/kau4hi/slam_ws/src/pytorch-NetVlad/netvlad_v100_datasets/runs/', savePath='checkpoints', seed=123, split='val', start_epoch=0, threads=8, vladv2=False, weightDecay=0.001) ===> Loading dataset(s) ===> Building model ===> Calculating descriptors and clusters ====> Extracting Descriptors ====> Clustering.. Traceback (most recent call last): File "main.py", line 498, in get_clusters(whole_train_set) File "main.py", line 281, in get_clusters kmeans.train(dbFeat[...]) File "/home/kau4hi/gpu_anaconda3/lib/python3.6/site-packages/faiss/__init__.py", line 734, in train clus.train(x, self.index, weights) File "/home/kau4hi/gpu_anaconda3/lib/python3.6/site-packages/faiss/__init__.py", line 85, in replacement_train self.train_c(n, swig_ptr(x), index) File "/home/kau4hi/gpu_anaconda3/lib/python3.6/site-packages/faiss/swigfaiss_avx2.py", line 1477, in train return _swigfaiss_avx2.Clustering_train(self, n, x, index, x_weights) ****NotImplementedError: Wrong number or type of arguments for overloaded function 'Clustering_train'. Possible C/C++ prototypes are: faiss::Clustering::train(faiss::Clustering::idx_t,float const *,faiss::Index &,float const *) faiss::Clustering::train(faiss::Clustering::idx_t,float const *,faiss::Index &**)**
mdouze commented 2 years ago

This seems to be related to another package than Faiss. Please check that the x is in float32.