UMass-Rescue / ImageSearch_CLIP

A system that creates clip embedding vectors for a large corpus of images, enabling efficient retrieval of images based on natural language text.
0 stars 1 forks source link

Ensure Embeddings Are Moved to CPU Before Passing to FAISS #68

Closed sravanigona closed 1 week ago

sravanigona commented 1 week ago

Description: Currently, the code generates image embeddings on the GPU using the CLIP model but doesn't ensure that the embeddings are moved to the CPU before passing them to the FAISS index. FAISS (when using faiss-cpu) expects embeddings to be on the CPU, and failing to move them can lead to device mismatch errors.

Outcome: Updated code to ensure that the embeddings generated on the GPU are moved to the CPU using .cpu() before they are passed to the FAISS index during search operation.