我想在我的系统上为PyTorch文档制作一个离线PDF。在阅读了几个资源( #1,#2,#3 )之后
git clone https://github.com/pytorch/pytorch
cd pytorch/docs/
make latexpdf前两个命令运行良好。第三个命令导致以下错误
Traceback (most recent call last):
File "source/scripts/build_activation_images.py", line 70, in <module>
function = torch.nn.modules.activation.__dict__[function_name]()
KeyError: 'SiLU'如何克服这个错误并制作一个PyTorch文档?
1.4.0是我的系统中PyTorch的版本。
print(torch.__version__)
1.4.03.8.3是我的系统中Python的版本。
python -V
Python 3.8.3发布于 2021-07-04 15:14:17
安装在您的计算机上的PyTorch版本(1.4.0)比您克隆的版本(最近的版本)要早。解决这个问题的两种方法:
git clone https://github.com/pytorch/pytorch
# move back to the 1.4 release, which you have installed in your machine
cd pytorch
git checkout release/1.4
cd docs
make latexpdf# upgrade PyTorch to the nightly release (change it accordingly)
python -m pip install --pre torch torchvision torchaudio -f https://download.pytorch.org/whl/nightly/cu102/torch_nightly.html
git clone https://github.com/pytorch/pytorch
cd pytorch/docs/
make latexpdfhttps://stackoverflow.com/questions/68244269
复制相似问题