Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to read model file! #5

Closed
AbhinavKoul opened this issue Dec 16, 2020 · 3 comments
Closed

Not able to read model file! #5

AbhinavKoul opened this issue Dec 16, 2020 · 3 comments

Comments

@AbhinavKoul
Copy link

In line 70
fisher_face_emotion = cv2.face.FisherFaceRecognizer_create() fisher_face_emotion.read('E:/GitHub/facifier/src/models/emotion_classifier_model_windows.xml')

I am getting an error as follows:
e:/GitHub/facifier/src/facifier.py Traceback (most recent call last): File "e:/GitHub/facifier/src/facifier.py", line 70, in <module> fisher_face_emotion.read('E:/GitHub/facifier/src/models/emotion_classifier_model_windows.xml') cv2.error: OpenCV(4.4.0) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-6lylwdcz\opencv\modules\core\src\persistence.cpp:2089: error: (-215:Assertion failed) isMap() in fu\src\persistence.cpp:2089: error: (-215:Assertion failed) isMap() in function 'cv::FileNode::operator []'

How to fix this?

Specifications

  1. Python 3.7.6 conda
  2. OpenCV(4.4.0)
@chandraseta
Copy link
Owner

I searched this error and found the same issue reported in opencv (opencv/opencv#14908)
Their solution is to retrain the model and it could load.

I'm guessing it's caused by newer version of OpenCV that removes the isMap() function.
Try downgrading to older versions of OpenCV such as 3.4.4 or 2.4.13.6

@AbhinavKoul
Copy link
Author

I tried with OpenCV 3.4.4, it still gave the same error, will retrain and get back with new update

@AbhinavKoul
Copy link
Author

It worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants