PyTorch离线文档编译方法及常见问题
编译方法
1、安装必要软件。
sudo apt update
sudo apt install git
sudo apt install python3 -y2、使用ubuntu下载pytorch项目。
git clone https://github.com/pytorch/pytorch.git3、创建python虚拟环境。
python -m venv myenv
source ./myenv/bin/activate4、进入pytorch文档目录。
cd pytorch/docs5、安装pip包。
pip install -r requirements.txt
pip install torch6、编译文档。
make html生成的文档在build/html目录。
常见问题
1、pip install -r requirements.txt报错:git clone --filter=blob:none --quiet https://github.com/pytorch/pytorch_sphinx_theme.git /home/liteng/myenv/src/pytorch-sphinx-theme did not run successfully. exit code: 128
网络问题,可以多试几次。
2、make html报错:ModuleNotFoundError: No module named 'torch'。
没有安装torch包,执行 pip install torch 即可。
3、make html报错:AttributeError: module 'numpy' has no attribute 'bool8'. Did you mean: 'bool'?。
numpy版本问题,执行以下代码即可:pip install numpy==1.26.4
4、make html报错:FileNotFoundError: [Errno 2] No such file or directory: 'katex'
katex版本问题,执行以下代码即可:pip install sphinxcontrib.katex==0.9.0
最后更新于1年前
本文由人工编写,AI优化,转载请注明原文地址: PyTorch离线文档编译方法及常见问题
推荐阅读
评论 (0)
发表评论
昵称:加载中...
暂无评论,快来发表第一条评论吧!