ubuntu20编译PyTorch 源码

1. 安装anaconda

2. 安装依赖

conda install numpy ninja pyyaml mkl mkl-include setuptools cmake cffi typing_extensions future six requests dataclasses

3. 取源码

git clone --recursive https://github.com/pytorch/pytorch

4. 编译

cd pytorch
export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"}
python setup.py install

5. 查看版本

python3

>>> import torch
>>> torch.__version__

https://download.csdn.net/download/eidolon_foot/13820327

参考:

https://github.com/pytorch/pytorch#from-source

猜你喜欢

转载自blog.csdn.net/eidolon_foot/article/details/111600999
今日推荐