Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I wanted to make an offline PDF on my system for PyTorch documentation. After reading from several resources #1, #2, #3

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

cd pytorch/docs/

make latexpdf

First two commands are working fine. Third command leads to the following error

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'

How to overcome this error and make a PDF document of PyTorch?


1.4.0 is the version of PyTorch in my system

print(torch.__version__)
1.4.0

3.8.3 is the version of Python in my system

python -V
Python 3.8.3
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
170 views
Welcome To Ask or Share your Answers For Others

1 Answer

The PyTorch version installed in your machine (1.4.0) is older than the one you cloned (most recent). Two ways to fix it:

  1. Checkout to the version you have installed (if you want the doc of 1.4 version):
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
  1. Upgrade to the most-recent PyTorch version (if you want the most recent doc):
# 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 latexpdf

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...