opencv-ai / oak-model-samples

73 stars 23 forks source link

Unable to run emotion_recognition_retail - attributeError: __args__ #11

Closed rupam-sap closed 2 years ago

rupam-sap commented 2 years ago

I have OAK-D and I am able to run other samples from depthAI on my OAK-D device. I am running on mac.

Followed the steps provided in blog.

I get the following output -

2021-09-28 15:21:56.790 | WARNING | modelplace_api.utils::13 - The 'pycocotools' package wasn't found. Slow encoding and decoding are used for the RLE mask. Traceback (most recent call last): File "/Users/i036148/oak-model-samples/emotion_recognition_retail/main.py", line 3, in from modelplace_api.visualization import draw_emotion_recognition_one_frame File "/Users/i036148/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages/modelplace_api/init.py", line 4, in import modelplace_api.visualization File "/Users/i036148/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages/modelplace_api/visualization.py", line 9, in from .objects import ( File "/Users/i036148/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages/modelplace_api/objects.py", line 64, in class Pose(pydantic.BaseModel): File "/Users/i036148/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages/pydantic/main.py", line 246, in new fields[ann_name] = inferred = ModelField.infer( File "/Users/i036148/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages/pydantic/fields.py", line 310, in infer return cls( File "/Users/i036148/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages/pydantic/fields.py", line 272, in init self.prepare() File "/Users/i036148/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages/pydantic/fields.py", line 364, in prepare self._type_analysis() File "/Users/i036148/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages/pydantic/fields.py", line 453, in _typeanalysis self.type = self.type_.args[0] File "/usr/local/Cellar/python@3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/typing.py", line 706, in getattr raise AttributeError(attr) AttributeError: args

PVSemk commented 2 years ago

Hello, sorry for a late response.

It seems to me that it is a pydantic related issue. Looks like they started to support python3.9 from 1.7 version (see corresponding MR) while we use the version 1.5.1. So, I'd suggest to try either upgrading pydantic (however, that wasn't tested) or downgrading python version (3.8 should be OK).

PVSemk commented 2 years ago

Closed due to inactivity Feel free to reopen it.