Skip to content

FaissException: input contains NaN's or Inf's during PQ training #9

@Quaternijkon

Description

@Quaternijkon

When running the provided example script examples/run_sift1m.sh to build an index on the SIFT1M dataset, the program crashes during the Product Quantizer (PQ) training phase.

$ bash examples/run_sift1m.sh
Loading groundtruth from /home/gpu/dry/ivf-hnsw/data/SIFT1M/sift_groundtruth.ivecs
Loading queries from /home/gpu/dry/ivf-hnsw/data/SIFT1M/sift_query.fvecs
0
1
Size Mb: 636
Constructing quantizer
0 %
10.0692 %
20.1384 %
30.2076 %
40.2768 %
50.346 %
60.4152 %
70.4844 %
80.5536 %
90.6229 %
Saving info to /home/gpu/dry/ivf-hnsw/models/SIFT1M/hnsw_M16_ef500.bin
Saving edges to /home/gpu/dry/ivf-hnsw/models/SIFT1M/hnsw_M16_ef500.ivecs
Training PQ codebooks
Training 16x256 product quantizer on 65536 vectors in 128D
Training PQ slice 0/16
Clustering 65536 points in 8D to 256 clusters, redo 1 times, 25 iterations
Preprocessing in 0.00 s
Iteration 24 (12.34 s, search 11.21 s): objective=2.30826e+07 imbalance=1.328 nsplit=0
Training PQ slice 1/16
terminate called after throwing an instance of 'faiss::FaissException'
what(): Error in virtual void faiss::Clustering::train(faiss::Clustering::idx_t, const float*, faiss::Index&) at /home/gpu/dry/ivf-hnsw/faiss/Clustering.cpp:77: Error: 'finite (x_in[i])' failed: input contains NaN's or Inf's
examples/run_sift1m.sh: line 108: 3009270 Aborted (core dumped) ${PWD}/bin/test_ivfhnsw_sift1m -M ${M} -efConstruction ${efConstruction} -nb ${nb} -nt ${nt} -nsubt ${nsubt} -nc ${nc} -nq ${nq} -ngt ${ngt} -d ${d} -code_size ${code_size} -opq ${opq} -k ${k} -nprobe ${nprobe} -max_codes ${max_codes} -efSearch ${efSearch} -path_base ${path_base} -path_learn ${path_learn} -path_gt ${path_gt} -path_q ${path_q} -path_centroids ${path_centroids} -path_precomputed_idx ${path_precomputed_idxs} -path_edges ${path_edges} -path_info ${path_info} -path_pq ${path_pq} -path_norm_pq ${path_norm_pq} -path_index ${path_index}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions