Skip to content

TypeError: 'NoneType' object is not subscriptable #17

Description

@morrowyn

Hi,

I have tried running the attendance example. However I run into the following error:
TypeError: 'NoneType' object is not subscriptable

Image faces_detected.jpg written to filesystem:  True
Client created (student_test.py file)
127.0.0.1 - - [28/May/2022 20:04:11] "POST / HTTP/1.1" 500 -
Traceback (most recent call last):
  File "E:\weaviate-examples\attendance-system-example\venv\Lib\site-packages\flask\app.py", line 2091, in __call__
    return self.wsgi_app(environ, start_response)
  File "E:\weaviate-examples\attendance-system-example\venv\Lib\site-packages\flask\app.py", line 2076, in wsgi_app
    response = self.handle_exception(e)
  File "E:\weaviate-examples\attendance-system-example\venv\Lib\site-packages\flask\app.py", line 2073, in wsgi_app
    response = self.full_dispatch_request()
  File "E:\weaviate-examples\attendance-system-example\venv\Lib\site-packages\flask\app.py", line 1518, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "E:\weaviate-examples\attendance-system-example\venv\Lib\site-packages\flask\app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "E:\weaviate-examples\attendance-system-example\venv\Lib\site-packages\flask\app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "E:\weaviate-examples\attendance-system-example\upload_student.py", line 44, in upload_image
    attendance = markAttendance(faces,own=True) #.drop_duplicates()
  File "E:\weaviate-examples\attendance-system-example\mark.py", line 18, in markAttendance
    name = testit(img)
  File "E:\weaviate-examples\attendance-system-example\student_test.py", line 87, in testit
    ans = res['data']['Get']['Students'][0]['labelName']
TypeError: 'NoneType' object is not subscriptable
127.0.0.1 - - [28/May/2022 20:04:11] "GET /?__debugger__=yes&cmd=resource&f=style.css HTTP/1.1" 200 -
127.0.0.1 - - [28/May/2022 20:04:11] "GET /?__debugger__=yes&cmd=resource&f=debugger.js HTTP/1.1" 200 -
127.0.0.1 - - [28/May/2022 20:04:11] "GET /?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 200 -
 * Detected change in 'E:\\weaviate-examples\\attendance-system-example\\upload_student.py', reloading
libpng warning: iCCP: known incorrect sRGB profile
 * Restarting with stat
C:\Program Files\JetBrains\PyCharm Community Edition 2020.2.2\plugins\python-ce\helpers\pydev\pydevd.py:1844: DeprecationWarning: currentThread() is deprecated, use current_thread() instead
  dummy_thread = threading.currentThread()
 * Debugger is active!
 * Debugger PIN: 521-878-846
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
127.0.0.1 - - [28/May/2022 20:04:59] "GET / HTTP/1.1" 200 -

I used the images from the following directories to test it out:
attendance-system-example\students and attendance-system-example\test

Regards,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions