Chroma InvalidDimensionException: Embedding Dimension Does Not Match Collection
Quick answer
A collection locks its vector size on first write. Use the same embedding model, or create a new collection for the new model.
Most likely fix: Use the matching embedding model
How to fix it
Try these in order — the most common fix is first.
1. Use the matching embedding model
- Check which model created the collection
- Pass the same embedding_function on every get_collection call
Did this fix it?2. Start a new collection for the new model
- Create a new collection
- Re-embed and add your documents
- Delete the old collection once verified
Did this fix it?
Symptoms
InvalidDimensionException: Embedding dimension 1536 does not match collection dimensionality 384 (numbers vary).
Why it happens
- Switched embedding model after the collection was created
- Collection reopened with a different embedding function
- Upgrading to 0.5.0 and opening old persistent data (per the Chroma cookbook)
This guide also covers
- chromadb embedding dimension does not match
- InvalidDimensionException chroma
- chroma dimension 384 1536
Still not working?
If Chroma keeps failing, you're not alone. See every Chroma problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to usOther Chroma errors
- Chroma "Your system has an unsupported version of sqlite3" Error
- Chroma pip install "Failed to build hnswlib" Error
- Chroma Data Disappears After Restart (Persistence Fix)
- Chroma "Collection Not Found" Error
- Chroma "Collection Already Exists" UniqueConstraintError
- Chroma "sqlite3.OperationalError: database is locked"
- Chroma "Could not connect to tenant default_tenant" Error
- Chroma "Cannot return the results in a contiguous 2D array. Probably ef or M is too small"