numpy CMake和OpenCV的策略问题

50pmv0ei  于 2023-10-19  发布在  其他
关注(0)|答案(1)|浏览(269)

我花了两天的时间试图解决这些问题,我试图使用GPU来运行我的代码,因为使用CPU会变得非常滞后。
所以这些就是问题所在

CMake Warning (dev) at cmake/OpenCVUtils.cmake:144 (find_package):
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:271 (find_python)
CMakeLists.txt:643 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:144 (find_package):
Policy CMP0146 is not set: The FindCUDA module is removed.  Run "cmake --help-policy CMP0146" for policy details.  Use the cmake_policy command to
set the policy and suppress this warning.`

Call Stack (most recent call first):
cmake/OpenCVDetectCUDA.cmake:21 (find_host_package)
cmake/OpenCVFindLibsPerf.cmake:43 (include)
CMakeLists.txt:750 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

我了解到这可能是关于一些新的政策,我试图改变Cmakelist.txt,但它就是不工作。
我尝试重新安装Cmake,但也不起作用。
我试着忽略这一点,看看它是否有效:我进入VS2019,点击“所有构建”,但它碰巧产生了数百个C1083错误
错误可能像

`C:/Users/擐祆???Documents/OpenCV_Cmake_Document/opencv-4.7.0/modules/imgproc/src/precomp.hpp': No such file or directory opencv_world_AVX512_SKX `

我是台湾人,所以这个问题可能是由语言引起的。
我使用OpenCV 4.7.0和Python 3.10.9,我的GPU是Geforce RTC3080。
我试图忽略警告,但这不起作用。

zi8p0yeb

zi8p0yeb1#

也许你可以看到'https://cmake.org/cmake/help/latest/policy/CMP0148.html'。我通过将if(POLICY CMP0148) cmake_policy(SET CMP0148 OLD) endif()添加到CMakeLists.txt中解决了这个问题

相关问题