# How do I config vector size of a module

**URL:** <https://forum.weaviate.io/t/how-do-i-config-vector-size-of-a-module/1449>\
**Category:** Support\
**Created:** [February 10, 2024, 9:21pm UTC](https://forum.weaviate.io/t/how-do-i-config-vector-size-of-a-module/1449 "2024-02-10T21:21:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![litlig](https://avatars.discourse-cdn.com/v4/letter/l/dbc845/32.png) [@litlig](https://forum.weaviate.io/u/litlig)\
**Post date:** [February 10, 2024, 9:21pm UTC](https://forum.weaviate.io/t/how-do-i-config-vector-size-of-a-module/1449/1 "2024-02-10T21:21:51Z")

</div>

I was following the attendance example here [weaviate-examples/attendance-system-example at main · weaviate/weaviate-examples · GitHub](https://github.com/weaviate/weaviate-examples/tree/main/attendance-system-example), however the near vector search fails due to error “explorer: get class: vector search: object vector search at index students: shard students\_hfx1X8zELvMi: vector search: knn search: distance between entrypint and query node: vector lengths don’t match: 2048 vs 128”

It looks like the vectorizer img2vec-neural returns 2024 vector, while when search the face\_recognition returns 128 dim embeding.

How can we config to make it right?

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [February 12, 2024, 10:31pm UTC](https://forum.weaviate.io/t/how-do-i-config-vector-size-of-a-module/1449/2 "2024-02-12T22:31:25Z")

</div>

Hi @litlig !! Welcome to our community 🤗

That example is a little bit old. I will take a look on that and see if we can update it.

Meanwhile, do you know about our free, online workshops?

> **[Events & Webinars | Weaviate - Vector Database](https://weaviate.io/community/events)**
>
> Join us at conferences, meetups, webinars or workshops

Thanks!

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [February 12, 2024, 11:25pm UTC](https://forum.weaviate.io/t/how-do-i-config-vector-size-of-a-module/1449/3 "2024-02-12T23:25:03Z")

</div>

Hi!

So, the error message is that this app is using it’s own encoding for the images in order to search, so instead of doing a `near image search` it doesn a near vector search here:

> <https://github.com/weaviate/weaviate-examples/blob/5115039327b6dbbfef73cb8012436cb1d386d36b/attendance-system-example/student_test.py#L85>

I changed it to this:

```auto
res = client.query.get(
        "Students", ["labelName", "_additional {certainty}"]
    ).with_near_image(
        {"image": path}
    ).do()

```

So now Weaviate does the image vectorization before querying using the same vectorization.

However… the results are far from optimal. It only finds one student always. Something is still off.

If you want a nice example on how to play with images, check this one out:

> **[GitHub - weaviate-tutorials/multimodal-workshop](https://github.com/weaviate-tutorials/multimodal-workshop)**
>
> Contribute to weaviate-tutorials/multimodal-workshop development by creating an account on GitHub.

thanks!

---

<div class="post-metadata">

**Author:** ![litlig](https://avatars.discourse-cdn.com/v4/letter/l/dbc845/32.png) [@litlig](https://forum.weaviate.io/u/litlig)\
**Post date:** [February 13, 2024, 3:52am UTC](https://forum.weaviate.io/t/how-do-i-config-vector-size-of-a-module/1449/4 "2024-02-13T03:52:53Z")

</div>

Thanks for the detailed reply @DudaNogueira. I’m wondering if it’s because the models are different for embedding at query and insert time. Anyways, I’ll check out the workshop you linked, thanks!

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [February 15, 2024, 1:01pm UTC](https://forum.weaviate.io/t/how-do-i-config-vector-size-of-a-module/1449/5 "2024-02-15T13:01:13Z")

</div>

Yes, that’s probably it.

For some reason, something has changed on a library that is returning different dimensions.

When you pass the image itself for Weaviate, it will then vectorize the near\_image with the same vectorizer used to index data, so the search will work.

---

<div class="post-metadata">

**Author:** ![sebawita](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/sebawita/32/5_2.png) [@sebawita](https://forum.weaviate.io/u/sebawita)\
**Post date:** [February 15, 2024, 6:17pm UTC](https://forum.weaviate.io/t/how-do-i-config-vector-size-of-a-module/1449/6 "2024-02-15T18:17:54Z")

</div>

Hey, we have an [image\_search example with clip in here](https://github.com/weaviate/recipes/blob/main/media-search/image_search_clip.ipynb)
