# yolov11_cpp **Repository Path**: SongpingWang/yolov11_cpp ## Basic Information - **Project Name**: yolov11_cpp - **Description**: yolov11_cpp - **Primary Language**: C++ - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2025-02-06 - **Last Updated**: 2025-04-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # yolov11_cpp #### 介绍 yolov11_cpp ### cuda12.4.1包 ``` https://developer.download.nvidia.cn/compute/cuda/12.4.1/local_installers/cuda_12.4.1_551.78_windows.exe https://developer.nvidia.com/downloads/compute/cudnn/secure/8.8.1/local_installers/12.0/cudnn-windows-x86_64-8.8.1.3_cuda12-archive.zip/ ``` ### libtorch2.6.0-cpu包 ``` https://download.pytorch.org/libtorch/cpu/libtorch-win-shared-with-deps-2.6.0%2Bcpu.zip https://download.pytorch.org/libtorch/cpu/libtorch-win-shared-with-deps-debug-2.6.0%2Bcpu.zip ``` ### libtorch2.6.0-gpu包 ``` https://download.pytorch.org/libtorch/cu124/libtorch-win-shared-with-deps-2.6.0%2Bcu124.zip https://download.pytorch.org/libtorch/cu124/libtorch-win-shared-with-deps-debug-2.6.0%2Bcu124.zip ``` ### 预编译参数 ``` _SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING _SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING opencv_core452d.lib opencv_imgcodecs452d.lib opencv_imgproc452d.lib opencv_highgui452d.lib asmjit.lib c10.lib cpuinfo.lib dnnl.lib fbgemm.lib fmtd.lib kineto.lib libprotobuf-lited.lib libprotobufd.lib libprotocd.lib pthreadpool.lib sleef.lib torch.lib torch_cpu.lib XNNPACK.lib ``` ```cpp #include #include #include #include int main() { auto device = torch::kCPU; // Deserialize the ScriptModule from a file using torch::jit::load(). torch::jit::script::Module module = torch::jit::load(FileName, device); assert(module != nullptr); std::cout << "ok\n"; // Create a vector of inputs. std::vector inputs; inputs.push_back(torch::ones({ 1,3,320,192 })); // Execute the model and turn its output into a tensor. auto o = module.forward(std::move(inputs)); at::Tensor output = o.toTensor(); std::cout << output.slice(/*dim=*/1, /*start=*/0, /*end=*/5) << '\n'; while (1); } ``` ### 大模型提问 ```json 你好,你是个深度学习专家,熟练掌握 pytorch/python, libtorch/C++,其中pytorch/libtorch版本号为2.6.0 背景: 我需要将 pytorch/python的yolov11训练代码使用libtorch/C++进行实现 需求: 要求libtorch/C++实现时不能违背pytorch/python实现的主体功能,尽可能使用一样的方法函数,如libtorch/C++不存在类似的方法使用相近或者类似的方法,实在没有则自己实现,并详细说明。 需求: 要求libtorch/C++实现时不能违背pytorch/python实现的主体功能,尽可能使用一样的方法函数,如libtorch/C++不存在类似的方法使用相近或者类似的方法,实在没有则自己实现,并详细说明。 ```