You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add_with_ids fail to work after merge is performed on ondisk IndexIVFPQ index;
The error message is as follows:
Assertion failed: (end_prev == inf || offset >= end_prev), function free_slot, file OnDiskInvertedLists.cpp, line 565.
Platform
OS: macOS 10.15.2/Ubuntu 16.04
Faiss version: V 1.6.3
Faiss compilation options:
./configure --without-cuda
make && make install
int nindex = index_shards->count();
if (standard_merge) {
for (int i = 1; i < nindex; i++) {
faiss::ivflib::merge_into(
index_shards->at(0), index_shards->at(i),
shift_ids);
}
//index_shards->sync_with_shard_indexes();
} else {
std::vector<const faiss::InvertedLists *> lists;
faiss::IndexIVFPQ *index0 = nullptr;
size_t ntotal = 0;
for (int i = 0; i < nindex; i++) {
auto index_ivf = dynamic_cast<faiss::IndexIVFPQ *>(index_shards->at(i));
assert (index_ivf);
if (i == 0) {
index0 = index_ivf;
}
lists.push_back(index_ivf->invlists);
ntotal += index_ivf->ntotal;
}
auto il = new faiss::OnDiskInvertedLists(
index0->nlist, index0->code_size,
strDataFile.c_str());
il->merge_from(lists.data(), lists.size());
index0->replace_invlists(il, true);
index0->ntotal = ntotal;
}
Summary
add_with_ids fail to work after merge is performed on ondisk IndexIVFPQ index;
The error message is as follows:
Assertion failed: (end_prev == inf || offset >= end_prev), function free_slot, file OnDiskInvertedLists.cpp, line 565.
Platform
OS: macOS 10.15.2/Ubuntu 16.04
Faiss version: V 1.6.3
Faiss compilation options:
./configure --without-cuda
make && make install
Running on:
Interface:
Reproduction instructions
Download the attached zip file and unzip the file.
ivfpqcnn0.index.zip
Use below code to reproduce the issue. (File path need to be changed accordingly.)
#include
#include
#include <unordered_map>
#include <pthread.h>
#include <gtest/gtest.h>
#include <faiss/IndexIVFFlat.h>
#include <faiss/utils/random.h>
#include <faiss/IndexFlat.h>
#include <faiss/IndexIVFFlat.h>
#include <faiss/IndexIVFPQ.h>
#include <faiss/index_io.h>
#include <faiss/AutoTune.h>
#include <faiss/clone_index.h>
#include <faiss/OnDiskInvertedLists.h>
#include <faiss/impl/AuxIndexStructures.h>
#include <faiss/utils/distances.h>
#include <faiss/IVFlib.h>
#include <faiss/MetaIndexes.h>
#include <spdlog/fmt/bundled/format.h>
using namespace std;
typedef faiss::Index::idx_t idx_t;
// parameters to use for the test
int d = 512;
size_t nb = 1000;
size_t nq = 100;
int nindex = 4;
int k = 10;
int nlist = 40;
struct CommonData {
};
CommonData cd;
std::string trainedPQFilePath= "/opt/data/trainedIndex/ivfpqcnn0.index";
string strHome="/opt/data/imagedb";
string pqfile = "ivfpq";
faiss::IndexIVFPQ * getEmptyIndex(int workerId)
{
}
int mergeIndex (faiss::IndexShards *index_shards ,string strDataFile, bool shift_ids,
bool standard_merge) {
typedef faiss::Index::idx_t idx_t;
//index_shards->sync_with_shard_indexes();
} else {
std::vector<const faiss::InvertedLists *> lists;
faiss::IndexIVFPQ *index0 = nullptr;
size_t ntotal = 0;
for (int i = 0; i < nindex; i++) {
auto index_ivf = dynamic_cast<faiss::IndexIVFPQ *>(index_shards->at(i));
assert (index_ivf);
if (i == 0) {
index0 = index_ivf;
}
lists.push_back(index_ivf->invlists);
ntotal += index_ivf->ntotal;
}
}
TEST(ONDISK,merge)
{
}
The text was updated successfully, but these errors were encountered: