版本:1.9.0(和torch版本一致)
步骤:
调试代码:
#include "torch/torch.h" #include "torch/script.h" int main() { torch::Tensor output = torch::randn({ 3,2 }); std::cout << output; return 0; }
版本:4.5.3
步骤:
调试代码:
# include <opencv2/opencv.hpp> #include <iostream> using namespace cv; using namespace std; int main() { Mat src = imread("D:\\VS_C++\\mm.png"); // 修改为测试图片路径 namedWindow("input image", WINDOW_AUTOSIZE); imshow("input image", src); waitKey(0); }
Visual2019 Libtorch和opencv环境配置
原文:https://www.cnblogs.com/chang-yuan/p/15200972.html