gpt4 book ai didi

opencv - 在没有 GPU 的情况下编译 OpenCV?

转载 作者:太空宇宙 更新时间:2023-11-03 20:39:28 26 4
gpt4 key购买 nike

我刚从 OpenCV/build 运行 cmake -D CMAKE_BUILD_TYPE=RELEASE ..,得到我的输出:

--   OpenCV modules:
-- To be built: core imgproc flann highgui features2d calib3d ml video
objdetect contrib nonfree gpu legacy photo python
stitching ts videostab
-- Disabled: -
-- Disabled by dependency: -
-- Unavailable: androidcamera java world

问题是,使用gpu 编译失败,可能是因为我的机器没有? (这是一个 EC2 实例)。

make 失败并出现奇怪的错误:

Scanning dependencies of target opencv_test_gpu
[ 72%] Building CXX object modules/gpu/CMakeFiles/opencv_test_gpu.dir/test/test_gpumat.cpp.o
[ 72%] Building CXX object modules/gpu/CMakeFiles/opencv_test_gpu.dir/test/utility.cpp.o
[ 73%] Building CXX object modules/gpu/CMakeFiles/opencv_test_gpu.dir/test/test_filters.cpp.o
[ 73%] Building CXX object modules/gpu/CMakeFiles/opencv_test_gpu.dir/test/test_copy_make_border.cpp.o
[ 73%] Building CXX object modules/gpu/CMakeFiles/opencv_test_gpu.dir/test/main.cpp.o
[ 73%] Building CXX object modules/gpu/CMakeFiles/opencv_test_gpu.dir/test/test_threshold.cpp.o
[ 73%] Building CXX object modules/gpu/CMakeFiles/opencv_test_gpu.dir/test/test_video.cpp.o
[ 73%] Building CXX object modules/gpu/CMakeFiles/opencv_test_gpu.dir/test/test_core.cpp.o
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.
make[2]: *** [modules/gpu/CMakeFiles/opencv_test_gpu.dir/test/test_core.cpp.o] Error 4
make[1]: *** [modules/gpu/CMakeFiles/opencv_test_gpu.dir/all] Error 2
make: *** [all] Error 2

我试过使用标志 -DOPENCV_MODULES_DISABLED_USER="gpu" 但它会产生奇怪的输出,其中 gpu 被列为 to be built < em>和 已禁用

--   OpenCV modules:
-- To be built: core imgproc flann highgui features2d calib3d ml video objdetect contrib nonfree gpu legacy photo python stitching ts videostab
-- Disabled: gpu
-- Disabled by dependency: -
-- Unavailable: androidcamera java world

如何在没有 gpu 的情况下进行编译?

最佳答案

要禁止构建特定模块,请使用

-D BUILD_opencv_{modulename}=OFF

在这种情况下,使用

-D BUILD_opencv_gpu=OFF

关于opencv - 在没有 GPU 的情况下编译 OpenCV?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15161278/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com