Reputation: 75
So, I'm trying to install openCV with GPU support on my laptop via cmake. I followed every single step from https://thinkinfi.com/install-opencv-gpu-with-cuda-for-windows-10/ and other tutorials from youtube, and cmake wasn't able to find some Python 3 parameters including Interpreters, Libraries, numpy, and install path. I have tried reinstalling all necessary software from beginning and tried others solution but none of them worked.
To make everything clear, I'll briefly explain what I have done.
D:\opencv_gpu\opencv_contrib-4.8.0\modules
cmake --build "D:\opencv_gpu\build" --target INSTALL --config Release
This is the warning message I get in every configuration which I believe leads to the error message below
Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
are removed. Run "cmake --help-policy CMP0148" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/OpenCVDetectPython.cmake:64 (find_host_package)
cmake/OpenCVDetectPython.cmake:280 (find_python)
CMakeLists.txt:649 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
and when I try to import cv2 this is the error that it gives (This is done after the whole process)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'cv2'
It should produce something like this after the configuration :
.
.
.
-- OpenCl: YES(NVD3D11)
-- Include path: D:/opencv_gpu/opencv-4.8.0/3rdparty/i
-- Link libraries: Dynamic load
-- Python 3:
-- Interpreter: D:/anaconda3/python.exe (ver 3.10.9)
-- Libraries: {path to directory}
-- numpy: {path to directory}
-- packages path: {path to directory}
-- Python (for build): D:/anaconda3/python.exe
.
.
.
But this is what I get:
.
.
.
-- OpenCl: YES(NVD3D11)
-- Include path: D:/opencv_gpu/opencv-4.8.0/3rdparty/i
-- Link libraries: Dynamic load
-- Python (for build): D:/anaconda3/python.exe
.
.
.
Some other information:
Checking CUDA version to ensure that it's installed nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Wed_Jul_14_19:47:52_Pacific_Daylight_Time_2021
Cuda compilation tools, release 11.4, V11.4.100
Build cuda_11.4.r11.4/compiler.30188945_0
Some tutorials mention that this problem arises because of having older version of numpy. So I run the command and it seems like I have the latest version of numpy pip install --upgrade numpy
Requirement already satisfied: numpy in d:\anaconda3\lib\site-packages (1.25.1)
Upvotes: 1
Views: 791