Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
174 views
in Technique[技术] by (71.8m points)

resources - Error in creating an offline PDF documentatin for PyTorch

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

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

1 Reply

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...