opencv读取本地图片报错: Unexpected Error: OpenCV(4.1.1) C:\projects\opencv-python\opencv\modules\imgproc\src

本文详细记录了一个关于OpenCV读取本地图片时遇到的错误,并深入分析了解决过程。作者通过排查发现,问题根源在于未使用绝对路径读取图片,导致cv2.imread()无法正确加载图片。通过修改代码,将相对路径更改为绝对路径,成功解决了OpenCV读取图片失败的问题。

错误记录:opencv读取本地图片报错: Unexpected Error: OpenCV(4.1.1) C:\projects\opencv-python\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

又一次愚蠢的错误

报错:

        for file in os.listdir(const.PATH_SRC):
            print("#####"+const.PATH_SRC)
            print("#####"+file)
            img = cv2.imread(file,1)
            gray_img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
        

            gray_img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)  这一句总是报错 

Unexpected Error: OpenCV(4.1.1) C:\projects\opencv-python\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

 

debug:

查了网上很多教程,大概有以下几个原因:

  1. 检查图片路径中是否有中文字符,应尽量避免中文字符的出现

  2. 文件路径分割有问题,如果在路径中使用的是“\”,可尝试将其改为“/”

  3. 读取文件的扩展名问题,“ *.jpeg” 改成 “ *.jpg”

但是这些对我都没用... 后来在查阅资料的时候,看到了这个

https://www.jb51.net/article/188239.htm(博客链接)

 然后输出了一下img变量,输出 None

图片根本就没有加载进来... 实际上是 cv2.imread() 这个位置出错了,只有 filepath 这个变量可能出错

原来没有用绝对路径... 根本找不到图片(我了个去!!

 

纠正:

        for file in os.listdir(const.PATH_SRC):
            print("#####"+const.PATH_SRC)
            file = const.PATH_SRC+file
            print("#####"+file)
            img = cv2.imread(file,1)
            print(img)

 

(gaussian_splatting) C:\Users\35845\3Dgaussian-splatting\SIBR_viewers>cmake -Bbuild . -- Selecting Windows SDK version 10.0.26100.0 to target Windows 10.0.15063.0. CMake Warning at CMakeLists.txt:21 (message): Untested version of cmake. If you checked everything is working properly, please update 3.27.0 in the main CmakeLists.txt with the version you tested. -- Git found: E:/Git/cmd/git.exe -- SIBR version : BRANCH HEAD COMMIT_HASH 4ae964a267cd7a844d9766563cf9d0b500131a22 TAG VERSION 0.9.6-142-g4ae964a -- Install path for RelWithDebInfo set to C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/install. -- Install path for Release set to C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/install. -- Install path for Debug set to C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/install. Note you can provide default program options for Visual Studio target properties by either setting a value for the cmake cached variable 'SIBR_PROGRAMARGS' or by setting a new environment variable 'SIBR_PROGRAMARGS' -- ****************** Handling core dependencies ****************** -- Checking glew [from C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs]... -- Found a 3rdParty GLEW dir : C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs/glew. -- FindGLEW: did not find GLEW CMake config file. Searching for libraries. -- FindGLEW: GLEW_USE_STATIC_LIBS is undefined. Treated as FALSE. -- FindGLEW: GLEW_INCLUDE_DIR: C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs/glew/glew-2.0.0/include -- FindGLEW: GLEW_INCLUDE_DIRS: C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs/glew/glew-2.0.0/include -- FindGLEW: CMAKE_FIND_LIBRARY_SUFFIXES for SHARED: .dll.lib;.lib;.a -- FindGLEW: CMAKE_FIND_LIBRARY_SUFFIXES for STATIC: .lib -- FindGLEW: GLEW_SHARED_LIBRARY_RELEASE: C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs/glew/glew-2.0.0/lib64/glew32.lib -- FindGLEW: GLEW_STATIC_LIBRARY_RELEASE: C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs/glew/glew-2.0.0/lib64/glew32s.lib -- FindGLEW: GLEW_SHARED_LIBRARY_DEBUG: C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs/glew/glew-2.0.0/lib64/glew32d.lib -- FindGLEW: GLEW_STATIC_LIBRARY_DEBUG: C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs/glew/glew-2.0.0/lib64/glew32sd.lib -- FindGLEW: GLEW_SHARED_LIBRARY: optimized;C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs/glew/glew-2.0.0/lib64/glew32.lib;debug;C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs/glew/glew-2.0.0/lib64/glew32d.lib -- FindGLEW: GLEW_STATIC_LIBRARY: optimized;C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs/glew/glew-2.0.0/lib64/glew32s.lib;debug;C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs/glew/glew-2.0.0/lib64/glew32sd.lib -- FindGLEW: GLEW_LIBRARIES: optimized;C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs/glew/glew-2.0.0/lib64/glew32.lib;debug;C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs/glew/glew-2.0.0/lib64/glew32d.lib -- FindGLEW: GLEW_VERSION_MAJOR: 2 -- FindGLEW: GLEW_VERSION_MINOR: 0 -- FindGLEW: GLEW_VERSION_MICRO: 0 -- FindGLEW: GLEW_VERSION: 2.0.0 -- FindGLEW: Creating GLEW::glew imported target. -- FindGLEW: Creating GLEW::GLEW imported target. -- Checking assimp [from C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs]... -- Found a 3rdParty ASSIMP dir : C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs/assimp. -- Checking ffmpeg [from C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs]... -- Found a 3rdParty FFMPEG dir : C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs/ffmpeg. -- Checking embree3 [from C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs]... -- Found a 3rdParty EMBREE3 dir : C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs/embree3. -- Checking eigen3 [from C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs]... -- Found a 3rdParty EIGEN3 dir : C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs/eigen3. -- Checking boost [from C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs]... -- Found a 3rdParty BOOST dir : C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs/boost. CMake Warning (dev) at cmake/windows/dependencies.cmake:173 (find_package): Policy CMP0144 is not set: find_package uses upper-case <PACKAGENAME>_ROOT variables. Run "cmake --help-policy CMP0144" for policy details. Use the cmake_policy command to set the policy and suppress this warning. CMake variable BOOST_ROOT is set to: C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs/boost/boost-1.71 For compatibility, find_package is ignoring the variable, but code in a .cmake module might still use it. Call Stack (most recent call first): cmake/windows/include_once.cmake:20 (include) src/CMakeLists.txt:46 (include_once) This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at cmake/windows/dependencies.cmake:173 (find_package): Policy CMP0167 is not set: The FindBoost module is removed. Run "cmake --help-policy CMP0167" for policy details. Use the cmake_policy command to set the policy and suppress this warning. Call Stack (most recent call first): cmake/windows/include_once.cmake:20 (include) src/CMakeLists.txt:46 (include_once) This warning is for project developers. Use -Wno-dev to suppress it. -- Checking nativefiledialog [from C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs]... -- Found a 3rdParty NATIVEFILEDIALOG dir : C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs/nativefiledialog. SPECIAL OPENCV HANDLING -- Checking opencv [from C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs]... -- Found a 3rdParty OPENCV dir : C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs/opencv. -- OpenCV ARCH: x64 -- OpenCV RUNTIME: vc17 -- OpenCV STATIC: OFF -- Found OpenCV 4.8.0 in C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs/opencv/install/x64/vc17/lib -- You might need to add C:\Users\35845\3Dgaussian-splatting\SIBR_viewers\extlibs\opencv\install\x64\vc17\bin to your PATH to be able to run your applications. -- Checking glfw [from C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs]... -- Found a 3rdParty GLFW dir : C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/extlibs/glfw. -- Library imgui already available, skipping. -- Library mrf already available, skipping. -- Library nanoflann already available, skipping. -- Library picojson already available, skipping. -- Library rapidxml already available, skipping. -- Library xatlas already available, skipping. CMake Deprecation Warning at extlibs/xatlas/xatlas/CMakeLists.txt:4 (cmake_minimum_required): Compatibility with CMake < 3.10 will be removed from a future version of CMake. Update the VERSION argument <min> value. Or, use the <min>...<max> syntax to tell CMake that the project requires at least <min> but has been updated to work with policies introduced by <max> or earlier. -- **************************************************************** -- Adding dataset_tools project -- BUILD_IBR_DATASET_TOOLS is OFF -- Adding ulr project -- BUILD_IBR_ULR is OFF -- Adding basic project -- BUILD_IBR_BASIC is ON -- Adding gaussianviewer project -- BUILD_IBR_GAUSSIANVIEWER is ON -- Populating library CudaRasterizer... CMake Error at C:/Program Files/CMake/share/cmake-4.1/Modules/CMakeDetermineCompilerId.cmake:928 (message): Compiling the CUDA compiler identification source file "CMakeCUDACompilerId.cu" failed. Compiler: Build flags: Id flags: --keep;--keep-dir;tmp -v The output was: 1 閫傜敤浜?.NET Framework MSBuild 鐗堟湰 17.14.23+b0019275e 鐢熸垚鍚姩鏃堕棿涓?2025/9/15 17:11:18銆? 鑺傜偣 1 涓婄殑椤圭洰鈥淐:\Users\35845\3Dgaussian-splatting\SIBR_viewers\build\CMakeFiles\4.1.1\CompilerIdCUDA\CompilerIdCUDA.vcxproj鈥?榛樿鐩爣)銆? PrepareForBuild: 姝e湪鍒涘缓鐩綍鈥淒ebug\鈥濄€? 宸插惎鐢ㄧ粨鏋勫寲杈撳嚭銆傜紪璇戝櫒璇婃柇鐨勬牸寮忚缃皢鍙嶆槧閿欒灞傛缁撴瀯銆傛湁鍏宠缁嗕俊鎭紝璇峰弬闃?https://aka.ms/cpp/structured-output銆? 姝e湪鍒涘缓鐩綍鈥淒ebug\CompilerIdCUDA.tlog\鈥濄€? InitializeBuildStatus: 姝e湪鍒涘缓鈥淒ebug\CompilerIdCUDA.tlog\unsuccessfulbuild鈥濓紝鍥犱负宸叉寚瀹氣€淎lwaysCreate鈥濄€? 姝e湪瀵光€淒ebug\CompilerIdCUDA.tlog\unsuccessfulbuild鈥濇墽琛?Touch 浠诲姟銆? AddCudaCompileDeps: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64\cl.exe /E /nologo /showIncludes /TP /D__CUDACC__ /D__CUDACC_VER_MAJOR__=11 /D__CUDACC_VER_MINOR__=8 /D_MBCS /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include" /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin" /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include" /I. /FIcuda_runtime.h /c C:\Users\35845\3Dgaussian-splatting\SIBR_viewers\build\CMakeFiles\4.1.1\CompilerIdCUDA\CMakeCUDACompilerId.cu 椤圭洰鈥淐:\Users\35845\3Dgaussian-splatting\SIBR_viewers\build\CMakeFiles\4.1.1\CompilerIdCUDA\CompilerIdCUDA.vcxproj鈥?1)姝e湪鑺傜偣 1 涓婄敓鎴愨€淐:\Users\35845\3Dgaussian-splatting\SIBR_viewers\build\CMakeFiles\4.1.1\CompilerIdCUDA\CompilerIdCUDA.vcxproj鈥?1:2) (CudaBuildCore 涓洰鏍?銆? CudaBuildCore: Compiling CUDA source file CMakeCUDACompilerId.cu... 姝e湪鍒涘缓鐩綍鈥淐:\Users\35845\3Dgaussian-splatting\SIBR_viewers\build\CMakeFiles\4.1.1\CompilerIdCUDA\CompilerIdCUDA\x64\Debug鈥濄€? cmd.exe /C "C:\Users\35845\AppData\Local\Temp\tmp84a56914311d4a54a27fb861465acf76.cmd" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin\nvcc.exe" -gencode=arch=compute_52,code=\"sm_52,compute_52\" --use-local-env -ccbin "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64" -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include" -G --keep-dir CompilerIdCUDA\x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -v -allow-unsupported-compiler -g -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FdDebug\vc143.pdb /FS /Zi /RTC1 /MDd " -o C:\Users\35845\3Dgaussian-splatting\SIBR_viewers\build\CMakeFiles\4.1.1\CompilerIdCUDA\CompilerIdCUDA\x64\Debug\CMakeCUDACompilerId.cu.obj "C:\Users\35845\3Dgaussian-splatting\SIBR_viewers\build\CMakeFiles\4.1.1\CompilerIdCUDA\CMakeCUDACompilerId.cu" (gaussian_splatting) C:\Users\35845\3Dgaussian-splatting\SIBR_viewers\build\CMakeFiles\4.1.1\CompilerIdCUDA>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin\nvcc.exe" -gencode=arch=compute_52,code=\"sm_52,compute_52\" --use-local-env -ccbin "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64" -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include" -G --keep-dir CompilerIdCUDA\x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -v -allow-unsupported-compiler -g -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FdDebug\vc143.pdb /FS /Zi /RTC1 /MDd " -o C:\Users\35845\3Dgaussian-splatting\SIBR_viewers\build\CMakeFiles\4.1.1\CompilerIdCUDA\CompilerIdCUDA\x64\Debug\CMakeCUDACompilerId.cu.obj "C:\Users\35845\3Dgaussian-splatting\SIBR_viewers\build\CMakeFiles\4.1.1\CompilerIdCUDA\CMakeCUDACompilerId.cu" #$ _NVVM_BRANCH_=nvvm #$ _SPACE_= #$ _CUDART_=cudart #$ _HERE_=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin #$ _THERE_=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin #$ _TARGET_SIZE_= #$ _TARGET_DIR_= #$ _TARGET_SIZE_=64 #$ _WIN_PLATFORM_=x64 #$ TOP=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin/.. #$ NVVMIR_LIBRARY_DIR=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin/../nvvm/libdevice #$ PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin/../nvvm/bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin/../lib;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64;C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64;;C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x86;;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\tools;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\ide;C:\Program Files (x86)\HTML Help Workshop;;C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64;C:\windows\Microsoft.NET\Framework64\v4.0.30319\;C:\windows\Microsoft.NET\Framework\v4.0.30319\;C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin;C:\windows\Microsoft.NET\Framework\v4.0.30319\;;E:\anaconda\envs\gaussian_splatting;E:\anaconda\envs\gaussian_splatting\Library\mingw-w64\bin;E:\anaconda\envs\gaussian_splatting\Library\usr\bin;E:\anaconda\envs\gaussian_splatting\Library\bin;E:\anaconda\envs\gaussian_splatting\Scripts;E:\anaconda\envs\gaussian_splatting\bin;E:\anaconda\condabin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\libnvvp;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0;C:\windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA App\NvDLISR;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;C:\Program Files\HP\OMEN-Broadcast\Common;E:\Git\cmd;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files\NVIDIA Corporation\Nsight Compute 2022.3.0;C:\ProgramData\anaconda3;C:\ProgramData\anaconda3\Scripts;C:\ProgramData\anaconda3\Library\bin;C:\Program Files\CMake\bin;C:\Users\35845\AppData\Local\Microsoft\WindowsApps;.; #$ INCLUDES="-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin/../include" #$ LIBRARIES= "/LIBPATH:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin/../lib/x64" #$ CUDAFE_FLAGS=--sdk_dir "C:\Program Files (x86)\Windows Kits\10" #$ PTXAS_FLAGS= CMakeCUDACompilerId.cu #$ cl.exe -D__NV_NO_HOST_COMPILER_CHECK=1 @"C:\Users\35845\AppData\Local\Temp/tmpxft_00003a2c_00000000-9.res" > "C:/Users/35845/AppData/Local/Temp/tmpxft_00003a2c_00000000-8_CMakeCUDACompilerId.cpp1.ii" CMakeCUDACompilerId.cu #$ erase C:\Users\35845\AppData\Local\Temp/tmpxft_00003a2c_00000000-9.res #$ cicc --microsoft_version=1944 --msvc_target_version=1944 --compiler_bindir "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/HostX64/x64/../../../../../../.." --display_error_number --orig_src_file_name "C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/build/CMakeFiles/4.1.1/CompilerIdCUDA/CMakeCUDACompilerId.cu" --orig_src_path_name "C:\Users\35845\3Dgaussian-splatting\SIBR_viewers\build\CMakeFiles\4.1.1\CompilerIdCUDA\CMakeCUDACompilerId.cu" --allow_managed --debug_mode --sdk_dir "C:\Program Files (x86)\Windows Kits\10" -arch compute_52 -m64 --no-version-ident -ftz=0 -prec_div=1 -prec_sqrt=1 -fmad=1 --include_file_name "tmpxft_00003a2c_00000000-4_CMakeCUDACompilerId.fatbin.c" -g -O0 -tused --gen_module_id_file --module_id_file_name "C:/Users/35845/AppData/Local/Temp/tmpxft_00003a2c_00000000-5_CMakeCUDACompilerId.module_id" --gen_c_file_name "C:/Users/35845/AppData/Local/Temp/tmpxft_00003a2c_00000000-7_CMakeCUDACompilerId.cudafe1.c" --stub_file_name "C:/Users/35845/AppData/Local/Temp/tmpxft_00003a2c_00000000-7_CMakeCUDACompilerId.cudafe1.stub.c" --gen_device_file_name "C:/Users/35845/AppData/Local/Temp/tmpxft_00003a2c_00000000-7_CMakeCUDACompilerId.cudafe1.gpu" "C:/Users/35845/AppData/Local/Temp/tmpxft_00003a2c_00000000-8_CMakeCUDACompilerId.cpp1.ii" -o "C:/Users/35845/AppData/Local/Temp/tmpxft_00003a2c_00000000-7_CMakeCUDACompilerId.ptx" C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\include\yvals_core.h(902): error : static assertion failed with "error STL1002: Unexpected compiler version, expected CUDA 12.4 or newer." [C:\Users\35845\3Dgaussian-splatting\SIBR_viewers\build\CMakeFiles\4.1.1\CompilerIdCUDA\CompilerIdCUDA.vcxproj] 1 error detected in the compilation of "C:/Users/35845/3Dgaussian-splatting/SIBR_viewers/build/CMakeFiles/4.1.1/CompilerIdCUDA/CMakeCUDACompilerId.cu". # --error 0x1 -- C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\BuildCustomizations\CUDA 11.8.targets(785,9): error MSB3721: 鍛戒护鈥?C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin\nvcc.exe" -gencode=arch=compute_52,code=\"sm_52,compute_52\" --use-local-env -ccbin "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64" -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include" -G --keep-dir CompilerIdCUDA\x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -v -allow-unsupported-compiler -g -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FdDebug\vc143.pdb /FS /Zi /RTC1 /MDd " -o C:\Users\35845\3Dgaussian-splatting\SIBR_viewers\build\CMakeFiles\4.1.1\CompilerIdCUDA\CompilerIdCUDA\x64\Debug\CMakeCUDACompilerId.cu.obj "C:\Users\35845\3Dgaussian-splatting\SIBR_viewers\build\CMakeFiles\4.1.1\CompilerIdCUDA\CMakeCUDACompilerId.cu"鈥濆凡閫€鍑猴紝杩斿洖浠g爜涓?1銆?[C:\Users\35845\3Dgaussian-splatting\SIBR_viewers\build\CMakeFiles\4.1.1\CompilerIdCUDA\CompilerIdCUDA.vcxproj] 宸插畬鎴愮敓鎴愰」鐩€淐:\Users\35845\3Dgaussian-splatting\SIBR_viewers\build\CMakeFiles\4.1.1\CompilerIdCUDA\CompilerIdCUDA.vcxproj鈥?CudaBuildCore 涓洰鏍?鐨勬搷浣?- 澶辫触銆? 宸插畬鎴愮敓鎴愰」鐩€淐:\Users\35845\3Dgaussian-splatting\SIBR_viewers\build\CMakeFiles\4.1.1\CompilerIdCUDA\CompilerIdCUDA.vcxproj鈥?榛樿鐩爣)鐨勬搷浣?- 澶辫触銆? 鐢熸垚澶辫触銆? 鈥淐:\Users\35845\3Dgaussian-splatting\SIBR_viewers\build\CMakeFiles\4.1.1\CompilerIdCUDA\CompilerIdCUDA.vcxproj鈥?榛樿鐩爣) (1) -> 鈥淐:\Users\35845\3Dgaussian-splatting\SIBR_viewers\build\CMakeFiles\4.1.1\CompilerIdCUDA\CompilerIdCUDA.vcxproj鈥?CudaBuildCore 鐩爣) (1:2) -> (CudaBuildCore 鐩爣) -> C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\include\yvals_core.h(902): error : static assertion failed with "error STL1002: Unexpected compiler version, expected CUDA 12.4 or newer." [C:\Users\35845\3Dgaussian-splatting\SIBR_viewers\build\CMakeFiles\4.1.1\CompilerIdCUDA\CompilerIdCUDA.vcxproj] C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\BuildCustomizations\CUDA 11.8.targets(785,9): error MSB3721: 鍛戒护鈥?C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin\nvcc.exe" -gencode=arch=compute_52,code=\"sm_52,compute_52\" --use-local-env -ccbin "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64" -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include" -G --keep-dir CompilerIdCUDA\x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -v -allow-unsupported-compiler -g -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FdDebug\vc143.pdb /FS /Zi /RTC1 /MDd " -o C:\Users\35845\3Dgaussian-splatting\SIBR_viewers\build\CMakeFiles\4.1.1\CompilerIdCUDA\CompilerIdCUDA\x64\Debug\CMakeCUDACompilerId.cu.obj "C:\Users\35845\3Dgaussian-splatting\SIBR_viewers\build\CMakeFiles\4.1.1\CompilerIdCUDA\CMakeCUDACompilerId.cu"鈥濆凡閫€鍑猴紝杩斿洖浠g爜涓?1銆?[C:\Users\35845\3Dgaussian-splatting\SIBR_viewers\build\CMakeFiles\4.1.1\CompilerIdCUDA\CompilerIdCUDA.vcxproj] 0 涓鍛? 2 涓敊璇? 宸茬敤鏃堕棿 00:00:01.51 Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-4.1/Modules/CMakeDetermineCompilerId.cmake:8 (CMAKE_DETERMINE_COMPILER_ID_BUILD) C:/Program Files/CMake/share/cmake-4.1/Modules/CMakeDetermineCompilerId.cmake:53 (__determine_compiler_id_test) C:/Program Files/CMake/share/cmake-4.1/Modules/CMakeDetermineCUDACompiler.cmake:162 (CMAKE_DETERMINE_COMPILER_ID) extlibs/CudaRasterizer/CudaRasterizer/CMakeLists.txt:14 (project) -- Configuring incomplete, errors occurred!
最新发布
09-16
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值