chroma
chroma copied to clipboard
[Bug]: collection.query RuntimeError: Cannot open header file
What happened?
1. init data
-
chroma_client = chromadb.PersistentClient(path=str(collection_dir))
-
chroma_collection = chroma_client.get_or_create_collection(name=collection_name)
- add some data
chroma_collection.upsert(ids=[id], embeddings=[embedding], documents=[document], metadatas=[metadata])
- stop this program
2. query and RuntimeError except
-
collection.query(query_embeddings=query_embeddings, n_results=100)
3. remove index_metadata.pickle
-
rm 64597cda-24ba-4d7a-8fc4-b96f1fc098d9/index_metadata.pickle
4. query and no RuntimeError except
5. restart program and query and RuntimeError except
6. remove index_metadata.pickle and restart program and query and RuntimeError no except
so, when index_metadata.pickle exists, will except RuntimeError
Versions
chromadb 0.4.2 python 3.11.4 windows 11
Relevant log output
Call function: query_result = collection.query(query_embeddings=query_embeddings, n_results=100)
File "python-env\Lib\site-packages\chromadb\api\models\Collection.py", line 223, in query
return self._client._query(
^^^^^^^^^^^^^^^^^^^^
File "python-env\Lib\site-packages\chromadb\api\segment.py", line 433, in _query
vector_reader = self._manager.get_segment(collection_id, VectorReader)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "python-env\Lib\site-packages\chromadb\segment\impl\manager\local.py", line 112, in get_segment
instance = self._instance(self._segment_cache[collection_id][scope])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "python-env\Lib\site-packages\chromadb\segment\impl\manager\local.py", line 131, in _instance
instance = cls(self._system, segment)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "python-env\Lib\site-packages\chromadb\segment\impl\vector\local_persistent_hnsw.py", line 107, in __init__
self._init_index(self._dimensionality)
File "python-env\Lib\site-packages\chromadb\segment\impl\vector\local_persistent_hnsw.py", line 149, in _init_index
index.load_index(
RuntimeError: Cannot open header file