QT学习之路[19]_深度学习初探libtorch_搭环境[01]
作者:互联网
下面是一些值得参考的教程:
一、搭开发环境
(在虚拟机Ubuntu中搭建)
解压后,(参考最上面的视频教程:C++人工智能教程(基于libtorch))
QTCreator中CMakeLists.txt修改为:
cmake_minimum_required(VERSION 3.5)
project(UnderWater LANGUAGES CXX)
set(Torch_DIR "/home/book/share/libtorch/libtorch/share/cmake/Torch")
find_package(Torch REQUIRED)
if(TORCH_FOUND)
message("Found Torch")
else()
message("Cannot found Torch")
endif()
add_executable(UnderWater main.cpp)
target_link_libraries(${PROJECT_NAME} ${TORCH_LIBRARIES})
二、用python训练模型
参考:使用YOLOv5训练模型
(1)搭建相关环境(参考上面的视频教程:PyTorch深度学习快速入门教程)
---------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
标签:教程,01,QT,参考,19,Torch,libtorch,入门教程 来源: https://blog.csdn.net/mm13420109325/article/details/119052291