[Python] Policy problems with CMake and OpenCV

Discussão em 'Python' iniciado por Stack, Janeiro 25, 2025.

  1. Stack

    Stack Membro Participativo

    I spent two days trying to fix these problems, I am trying to build for OpenCV using GPU to run my code, because it gets really laggy using CPU.

    So these are the problem

    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.


    I've learned that it could be about some new policy and I tried to change Cmakelist.txt, but it just doesn't work.

    I've tried to reinstall Cmake, but doesn't work either.

    And I tried to ignore that to see if it works after all : I went into VS2019, hit "All Build", but it happened to make hundreds of C1083 Error.

    The Error may be like

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



    I'm Taiwanese so the issue could be caused by the language.

    I'm using OpenCV 4.7.0 & Python 3.10.9 and my GPU is Geforce RTC3080.

    I tried to ignore the warning, but that does not work. [​IMG]

    Continue reading...

Compartilhe esta Página