app开发者平台在数字化时代的重要性与发展趋势解析
726
2022-11-23
LibTorch在windows下编译
文章目录
准备工作文件目录进行编译
准备工作
cmakelibTorch
文件目录
进行编译
CMakeLists.txt
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)project(example-app)find_package(Torch REQUIRED)find_package(OpenCV REQUIRED)if(NOT Torch_FOUND) message(FATAL_ERROR "Pytorch Not Found!")endif(NOT Torch_FOUND)message(STATUS "Pytorch status:")message(STATUS " libraries: ${TORCH_LIBRARIES}")message(STATUS "OpenCV library status:")message(STATUS " version: ${OpenCV_VERSION}")message(STATUS " libraries: ${OpenCV_LIBS}")message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}")add_executable(example-app example.cpp)target_link_libraries(example-app ${TORCH_LIBRARIES} ${OpenCV_LIBS})set_property(TARGET example-app PROPERTY CXX_STANDARD 11)
example.cpp
#include
设置libTorch和opencv的根目录
cmake -DCMAKE_PREFIX_PATH=D:\MyWorkSpace\Lib\opencv\build\x64\vc15\lib;D:\MyWorkSpace\Lib\libtorch -DCMAKE_BUILD_TYPE=Release -G “Visual Studio 15 Win64” …
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~