longcw / yolo2-pytorch

YOLOv2 in PyTorch
1.54k stars 421 forks source link

opencv error when running demo.py #24

Open sangthian opened 7 years ago

sangthian commented 7 years ago

after running python demo.py, an error occur.

I install all the packages in anaconda's pytorch env. my opencv is 2.4.10( conda install opencv=2.4.10)

OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvShowImage, file -------src-dir-------/opencv-2.4.10/modules/highgui/src/window.cpp, line 501
Traceback (most recent call last):
  File "demo.py", line 65, in <module>
    cv2.imshow('test', im2show)
cv2.error: -------src-dir-------/opencv-2.4.10/modules/highgui/src/window.cpp:501: error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon 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
tegg89 commented 7 years ago

I also have the same error message on running demo.py.

I use Ubuntu 16.04 and installed opencv via pip install opencv-python.

xmfbit commented 7 years ago

@tegg89 @Jmx5200 This has nothing to do with YOLO2-Pytorch. You should re-install opencv package. It works well for me.

conda remove opencv
conda update conda
conda install --channel menpo opencv

For more detail, see https://stackoverflow.com/questions/40207011/opencv-not-working-properly-with-python-on-linux-with-anaconda-getting-error-th

pingaowang commented 6 years ago

conda install --channel menpo opencv doesn't work for me. But pip install opencv-python works.