【发布时间】:2020-01-24 10:08:55
【问题描述】:
问题:
尝试在 Ubuntu 18.04 上从 github 导入最新可用的 OpenCV 的新编译版本后出现分段错误。
这是我在尝试将cv2 导入Python 3 时收到的错误消息:
$ python3
Python 3.6.8 (default, Aug 20 2019, 17:12:48)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
python3: Relink `/lib/x86_64-linux-gnu/libsystemd.so.0' with `/lib/x86_64-linux-gnu/librt.so.1' for IFUNC symbol `clock_gettime'
python3: Relink `/lib/x86_64-linux-gnu/libudev.so.1' with `/lib/x86_64-linux-gnu/librt.so.1' for IFUNC symbol `clock_gettime'
Segmentation fault (core dumped)
我的 Ubuntu; 5.0.0-29-generic x86_64 GNU/Linux
从我克隆 OpenCV 的地方; https://github.com/opencv/opencv
相关话题;
getting error while importing cv2 module in ubuntu amazon instance
Configure AWS Redshift on Ubuntu 18.04 and use it with pyodbc
https://unix.stackexchange.com/questions/444697/cannot-run-python-file-asks-to-relink-libraries
https://github.com/tensorflow/tensorflow/issues/19375
所提供的解决方案均无效,因为我的笔记本电脑上没有任何 NVidia 图形芯片;
$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 5500 (rev 09)
通知:
我需要从源代码编译 OpenCV,因为我想使用 SIFT 和 SURF detectors 和 descriptors 当 OpenCV 与 apt 一起安装时它们不再可用:
>>> import cv2
>>> cv2.__version__
'4.2.0'
>>> cv2.xfeatures2d.SIFT_create()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
cv2.error: OpenCV(4.2.0)
/io/opencv_contrib/modules/xfeatures2d/src/sift.cpp:1210:
error: (-213:The function/feature is not implemented)
This algorithm is patented and is excluded in this configuration;
Set OPENCV_ENABLE_NONFREE CMake option and rebuild the library in
function 'create'
【问题讨论】:
-
哟..你有没有解决这个问题..我也有一个更棘手的问题。认为它与 GPU 驱动程序或配置有关。我不知道如何解决
-
我暂时没有修复它。如果我找到任何改进的方法,我会更新主帖。
-
如果您已经找到解决方案就好了。
标签: python-3.x opencv segmentation-fault