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

Error when running detect.py cv2.error: OpenCV(4.5.5) #8176

Closed
1 of 2 tasks
edehino opened this issue Jun 11, 2022 · 5 comments
Closed
1 of 2 tasks

Error when running detect.py cv2.error: OpenCV(4.5.5) #8176

edehino opened this issue Jun 11, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@edehino
Copy link

edehino commented Jun 11, 2022

Search before asking

  • I have searched the YOLOv5 issues and found no similar bug report.

YOLOv5 Component

Detection

Bug

File "D:\path\yolov5\utils\general.py", line 1012, in imshow
    imshow_(path.encode('unicode_escape').decode(), im)
cv2.error: OpenCV(4.5.5) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:1268: 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'

Environment

  • YOLO: YOLOv5
  • OS: Windows 10
    -Python: 3.9

Minimal Reproducible Example

Just clone the new repository or use git pull and try to detect any image/video. Tried both but I am getting the same error

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@edehino edehino added the bug Something isn't working label Jun 11, 2022
edehino referenced this issue Jun 11, 2022
* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update
@edehino
Copy link
Author

edehino commented Jun 11, 2022

pip uninstall opencv-python-headless -y

pip install opencv-python --upgrade

worked for me btw

@edehino edehino closed this as completed Jun 11, 2022
@glenn-jocher
Copy link
Member

@edehino thanks for the tip! I'll try this in the docker image to see if it can resolve the cv2 4.6 errors I've been seeing

@glenn-jocher
Copy link
Member

@edehino doesn't affect Docker image as if I try to uninstall I get:

WARNING: Skipping opencv-python-headless as it is not installed.

@Manpreeth3126
Copy link

same problem

@glenn-jocher
Copy link
Member

Hello! It looks like you're experiencing a similar issue. Could you please try the solution provided by @Manpreeth3126?

pip uninstall opencv-python-headless -y 
pip install opencv-python --upgrade

This has helped others with the same problem. If the issue persists after trying this, please let us know. 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants