Open morrowyn opened 2 years ago
And this is the result from student_add.py:
Client created (student_add.py file)
Schema class created
6 Student images from Mbappe added.
7 Student images from Messi added.
7 Student images from Ronaldo added.
Images added
This is the response from res = client.query.get("Students", ["labelName", "_additional {certainty}"]).with_near_vector(nearVector).do()
{'data': {'Get': {'Students': None}}, 'errors': [{'locations': [{'column': 6, 'line': 1}], 'message': "explorer: get class: vector search: object vector search at index students: shard students_YaDbfHtOdSyd: vector search: knn search: distance between entrypint and query node: vector lengths don't match: 2048 vs 128", 'path': ['Get', 'Students']}]}
CC: @sky-2002 – can you maybe help out? Thanks :)
Sure @bobvanluijt , I will look into this and get back ! Thanks @morrowyn for bringing up the issue.
Hello @morrowyn , as you mentioned, you have used the directories "attendance-system-example\students" and "attendance-system-example\test" to test out the example, I believe that you have used the "/students" directory to add the individual images and you tried to test on test images.
After looking at the response that you have provided, "{'data': {'Get': {'Students': None}}, 'errors': [{'locations': [{'column': 6, 'line': 1}], 'message': "explorer: get class: vector search: object vector search at index students: shard students_YaDbfHtOdSyd: vector search: knn search: distance between entrypint and query node: vector lengths don't match: 2048 vs 128", 'path': ['Get', 'Students']}]}"
It says that the vector lengths do not match.
Probable reason: What I believe to be a probable reason for this might be that you are using your own vectors while adding data i.e. you are using the "student_own_add.py" file, which uses OpenCV functions to generate a face vector/embedding of length 128. But while querying, maybe you are using the "testImage" function which uses weaviate module to vectorize the image. And as the weaviate's module generates a vector of length 2048, there is no possibility of finding a dot product between these vectors. And hence the issue. I suggest to use the "testit" function to test images when you are using your own vectors. And the "testImage" function when using modules.
Something else 🤔 ? If the above is not the case, please do let me know here or reach out via slack. Though I feel that the above mentioned reason is the cause of this, I am still looking for more places in the code where this can go wrong. I will let you know if I find something else that causes this same issue.
Things learnt from this: I think I should name the functions so that they are more intuitive, I will definitely fix that, also I am adding some checks to the code which will prevent these kind of issues and raise informative errors so as to make it easy to fix.
Thanks ! 😇
Hi,
I have tried running the attendance example. However I run into the following error:
TypeError: 'NoneType' object is not subscriptable
I used the images from the following directories to test it out:
attendance-system-example\students
andattendance-system-example\test
Regards,