[英]Error during the compilation of OpenCV with CUDA and FFMpeg on Ubuntu 18.04
I have a requirement to install OpenCV compiled with CUDA and FFMpeg for an optical flow calculation. 我需要安装用CUDA和FFMpeg编译的OpenCV进行光流计算。
I followed this post to install on Ubuntu 18.04, but I am getting the following error shown in the below screenshot when I am trying to execute the following command: 我按照这篇文章在Ubuntu 18.04上安装,但是当我尝试执行以下命令时,在以下屏幕截图中显示了以下错误:
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=ON \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
-D BUILD_EXAMPLES=ON \
-D BUILD_opencv_python2=OFF \
-D WITH_FFMPEG=1 \
-D WITH_CUDA=ON \
-D CUDA_GENERATION=Pascal \
-D ENABLE_FAST_MATH=1 \
-D CUDA_FAST_MATH=1 \
-D WITH_CUBLAS=1 \
-D PYTHON_DEFAULT_EXECUTABLE=/opt/anaconda/bin/python \
-D PYTHON3_INCLUDE_DIR=/opt/anaconda/include/python3.5m \
-D PYTHON3_LIBRARY=/opt/anaconda/lib/libpython3.5m.so \
-D PYTHON3_PACKAGES_PATH=/opt/anaconda/lib/python3.5 \
-D WITH_LAPACK=OFF \
-D PYTHON3_NUMPY_INCLUDE_DIRS=/opt/anaconda/lib/python3.5/site-packages/numpy/core/include ..
I have installed the CUDA version 10.0 我已经安装了CUDA版本10.0
It would be of a great help, if you can guide me to fix this error or suggest me a different procedure to install OpenCV compiled with CUDA and FFMpeg on Ubuntu 18.04. 如果您可以指导我解决此错误,或建议我使用其他过程在Ubuntu 18.04上安装使用CUDA和FFMpeg编译的OpenCV,则将有很大的帮助。
Thanks! 谢谢!
Just to put the information as an answer 只是为了将信息作为答案
What you describe, seems to be the same issue as in this one in github of opencv. 您描述的内容似乎与opencv的github中的这个问题相同。 In which the CUDA_CUDA_LIBRARY is not found.
在其中找不到CUDA_CUDA_LIBRARY。 One can set this manually with:
可以使用以下方法手动设置:
-DCUDA_CUDA_LIBRARY=/usr/local/cuda/lib64/stubs/libcuda.so
or you can also use: 或者您也可以使用:
-DCMAKE_LIBRARY_PATH=/usr/local/cuda/lib64/stubs
Which will give a hint of where to look for this library. 这将提示在哪里可以找到该库。
For the other problem in your comment, it seems like some python file could not be found. 对于您评论中的另一个问题,似乎找不到某些python文件。 Most probably related to this:
最可能与此有关:
-D PYTHON_DEFAULT_EXECUTABLE=/opt/anaconda/bin/python \
-D PYTHON3_INCLUDE_DIR=/opt/anaconda/include/python3.5m \
-D PYTHON3_LIBRARY=/opt/anaconda/lib/libpython3.5m.so \
-D PYTHON3_PACKAGES_PATH=/opt/anaconda/lib/python3.5 \
You should check if you have those folders/files. 您应该检查是否有那些文件夹/文件。 If the version is the correct one (3.5) or if it is a newer one (3.6 or 3.7).
如果版本是正确的版本(3.5)或较新的版本(3.6或3.7)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.