天天看點

opencv出錯:error: (-213:The function/feature is not implemented) Unknown/unsupported array type

Python

調用

OpenCV

,莫名其妙出現以下錯誤:

Traceback (most recent call last):
  File "./consite_faceid.py", line 293, in consite_faceid_post_action
    str_img = cv2.imencode('.jpg', img)[1].tostring()
error: OpenCV(3.4.5) /home/quantum6/gh-install-cuda9/opencv-3.4.5/modules/core/src/matrix_wrap.cpp:840: error: (-213:The function/feature is not implemented) Unknown/unsupported array type in function 'type'
 
(308, 'traceback.print_exc():', None)
(309, 'traceback.format_exc():\nTraceback (most recent call last):\n  File "./consite_faceid.py", line 293, in consite_faceid_post_action\n    str_img = cv2.imencode(\'.jpg\', img)[1].tostring()\nerror: OpenCV(3.4.5) /home/quantum6/gh-install-cuda9/opencv-3.4.5/modules/core/src/matrix_wrap.cpp:840: error: (-213:The function/feature is not implemented) Unknown/unsupported array type in function \'type\'\n\n')      

反複編譯了幾次OpenCV,還是錯誤.

後來解除安裝OpenCV:

sudo pip uninstall opencv-python
sudo apt remove    python-opencv      

繼續閱讀