您的位置:首页 > 财经 > 金融 > 【小白教程(无伤速通)】Visual Studio中Libtorch安装与配置

【小白教程(无伤速通)】Visual Studio中Libtorch安装与配置

2025/1/7 23:37:25 来源:https://blog.csdn.net/weixin_47524641/article/details/141787018  浏览:    关键词:【小白教程(无伤速通)】Visual Studio中Libtorch安装与配置

1. Libtorch下载

Download here (Release version):

https://download.pytorch.org/libtorch/cpu/libtorch-win-shared-with-deps-1.8.0%2Bcpu.zip

Download here (Debug version):

https://download.pytorch.org/libtorch/cpu/libtorch-win-shared-with-deps-debug-1.8.0%2Bcpu.zip

2. 配置

包含目录

库目录

环境变量
链接器

2.1 包含目录

Debug

D:\ProgramData\libtorch-win-shared-with-deps-debug 1.8.0+cpu\libtorch\include\torch\csrc\api\include
D:\ProgramData\libtorch-win-shared-with-deps-debug-1.8.0+cpu\libtorch\include

Release

D:\ProgramData\libtorch-win-shared-with-deps-1.8.0+cpu\libtorch\include\torch\csrc\api\include
D:\ProgramData\libtorch-win-shared-with-deps-1.8.0+cpu\libtorch\include

2.2 库目录

Debug

D:\ProgramData\libtorch-win-shared-with-deps-debug-1.8.0+cpu\libtorch\lib

Release

D:\ProgramData\libtorch-win-shared-with-deps-1.8.0+cpu\libtorch\lib

2.3 环境变量

Debug

PATH=D:\ProgramData\libtorch-win-shared-with-deps-debug-1.8.0+cpu\libtorch\lib;%PATH%

Release

PATH=D:\ProgramData\libtorch-win-shared-with-deps-1.8.0+cpu\libtorch\lib;%PATH%

【注意】这里不要勾选从父级或项目默认设置继承

2.4 链接器

Debug

D:\ProgramData\libtorch-win-shared-with-deps-debug-1.8.0+cpu\libtorch\lib\*.lib

Release

D:\ProgramData\libtorch-win-shared-with-deps-1.8.0+cpu\libtorch\lib\*.lib

【注意】这里要勾选从父级或项目默认设置继承!!!

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com