windows pytorch caffe2 安装

本文档详细介绍了如何在Windows操作系统中安装PyTorch及其依赖库Caffe2,通过运行build_windows.bat脚本来完成配置和构建过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


下载 Visual Studio Community Edition 2017
下载Python 2.7.14 (x86-64) 和 Microsoft Visual C++ Compiler for Python 2.7.
把 C:\Python27 and C:\Python27\scripts 加入到windows Path变量中。
下载下列依赖包
pip install future ^
            hypothesis ^
            numpy ^
            protobuf ^
            six
pip install flask ^
            glog ^
            graphviz ^
            jupyter ^
            matplotlib ^
            pydot python-nvd3 ^
            pyyaml ^
            requests ^
            scikit-image ^
            scipy ^
            setuptools ^
            tornado
clone pytorch源码到本地。
git clone --recursive https://github.com/pytorch/pytorch.git
编辑 ‘\scripts\build_windows.bat’
找到其中的 set BUILD_PYTHON 设置为 ON
运行Developer Command Prompt for VS 2017,
找到pytorch中\scripts文件夹,先在命令行中运行set CMAKE_GENERATOR="Visual Studio 15 2017 Win64" 将CAMKE编译器换成2017版本然后在命令行中输入

call build_windows.bat

最后在环境变量中加入PYTHONPATH这个环境变量
路径设置为pytorch\build 所在路径。大功告成

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值