yu4u / age-gender-estimation

Keras implementation of a CNN network for age and gender estimation
MIT License
1.46k stars 502 forks source link

cv2.imshow returns error #143

Open samlaf opened 3 years ago

samlaf commented 3 years ago

I'm on Ubuntu 20.04, opencv4.5.2 (downloaded via pip3 install opencv-python). When running python3 demo.py I was getting

Traceback (most recent call last):
  File "demo.py", line 136, in <module>
    main()
  File "demo.py", line 128, in main
    cv2.imshow("result", img)
cv2.error: OpenCV(4.5.2) /tmp/pip-req-build-itd46xp8/opencv/modules/highgui/src/window.cpp:679: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvShowImage'

Following https://stackoverflow.com/a/14656610/4971151, I installed opencv-contrib-python and it solved the problem.