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
The PyTorch version installed in your machine (1.4.0) is older than the one you cloned (most recent). Two ways to fix it:
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
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
Related
all. I am trying to install shapely via the .whl using pip. I have python 3.6.13 running on anaconda prompt. I have downloaded the shapely .whl using this site. However, when I run the commands shown in the image below, I get the error "shapely... is not a supported wheel on this platform."
From what I understand, I have a 64 bit architecture and python 3.6 (although it is python 3.6.13). I have tried to just request python 3.6 flat from the virtual environment setup by using the following command:
conda create -n stormEnv python=3.6
However, this command always returns a python version that is higher than a flat 3.6.
I am wondering if there is a way to get a python version that is a flat 3.6, or if I am just using the wrong .whl file from https://www.lfd.uci.edu/~gohlke/pythonlibs/
I have also tried the 3.6 32bit architecture as shown in the next image without any success:
Thanks for any help you can provide.
Since you're working with conda, the first thing you should try is:
conda install shapely
There is likely to be an existing build for your platform available in conda forge.
Wheel files are tagged with compatibility markers, and you should not attempt to install an incompatible wheel directly, because the the compiled artifacts inside the wheel will not work on your platform. You'll have to find a wheel which is supported on your platform - to see the list of supported tags run:
python -m pip debug -v
If there are no compatible wheels available, you'll have to install the necessary build dependencies and then install directly from source code.
When I use pytorch, it showed that my the cuda version pytorch used and cuda version of system are inconsistent, so I need rebuild pytorch from source.
# install dependency
pip install astunparse numpy ninja pyyaml mkl mkl-include setuptools cmake cffi typing_extensions future six requests dataclasses
# Download pytorch source
git clone --recursive https://github.com/pytorch/pytorch
cd pytorch
# if you are updating an existing checkout
git submodule sync
git submodule update --init --recursive --jobs 0
# Build
#if you want to use pytorch with cuda ,please `USE_CUDA=1`
python setup.py install
#torchvision install with source
# Download
git clone --recursive --branch v0.11.1 https://github.com/pytorch/vision.git
cd vision
python setup.py install
Building pytorch from source is not trivial, there is extensive documentation for it hereenter link description here .
However I think you should try to either install directly a an older pytorch version compatible with your system version of cuda or use docker with the version (safer option).
You could also try to update your CUDA system if it supports newer drivers, good luck.
I was updating my git repo using the below command
python3 helper.py --update SomeName
But it is showing error like:
Traceback (most recent call last):
File "helper.py", line 13, in <module>
import git
ModuleNotFoundError: No module named 'git'
I have installed both Python 3 (3.8.5) and Python 2 (2.7.18).
Following Installing GitPython, a simple pip install GitPython should be enough.
If not, check gitpython-developers/GitPython issue 1051:
Even though I don't know what is causing this I do know that GitPython 2.x is supposed to work with Python 2 and 3, whereas GitPython 3 only works with Python 3.
It's hard to understand what exactly happened here, but when running pip3 install GitPython I am also unable to successfully run import git.
My best guess is that pip installs things outside of the PYTHONPATH, which certainly is surprising
What worked in my case, on Windows, was
python3 -m pip install gitpython
Even after installing GitPython through pip3, the module was not being found, even if I included the appropriate paths. What worked is the command I mention.
I am trying to install deepmatcher package in python 3.6. To let this package to run in python you need have a torch==0.3.1 version. So I am trying to install torch==0.3.1 by running :
pip install torch==0.3.1
Error during installation:
Collecting torch==0.3.1
ERROR: Could not find a version that satisfies the requirement torch==0.3.1 (from versions: 0.1.2, 0.1.2.post1)
ERROR: No matching distribution found for torch==0.3.1
I even tried installing it using "peterjc123" package but still unable to uninstall it.
torch 0.3.1 is not listed official anymore. To install torch 0.3.1 one can either build it by source or using a whl file for the specific version.
Using a whl file
whl files can be found here provided by pytorch
The downloaded file can then be installed with pip install [path to downloaded file]
Build by source
To build torch by source one can checkout the desired version via git
git checkout v[version number]
For torch==0.3.1 this would be git checkout v0.3.1
After this follow the install instructions provided by README.md
More information can be found at: https://pytorch.org/get-started/previous-versions/
check if you have right python installed for you os architecture or
create a virtual env using conda and then try installing its better this way
I'm trying to install Blocks on my Linux machine and I have some troubles. How can I fix this? I'm doing the following steps:
Installing Anaconda for python2.
Theano depends on numpy 1.10.1 version. If at this step I will run import theano in python shell then it will work perfectly.
Okay, it's time for Blocks. I'm installing stable version using pip install --user git+git://github.com/mila-udem/blocks.git \
-r https://raw.githubusercontent.com/mila-udem/blocks/master/requirements.txt
After this step if I import theano it gives the following: RuntimeError: module compiled against API version a but this version of numpy is 9.
I looked at requirements.txt and see that Blocks depends on numpy 1.9.3.
I uninstalled Theano, Blocks, downgraded numpy using conda install numpy=1.9.3, then just run again pip install --user git+git://github.com/mila-udem/blocks.git \
-r https://raw.githubusercontent.com/mila-udem/blocks/master/requirements.txt and still while importing theano it gives me RuntimeError: module compiled against API version a but this version of numpy is 9.
How can I overcome this problem?
This could be a problem with the Anaconda distribution. You could try updating all of Anaconda via conda update conda and conda update --all. You could also try changing Blocks requirements.txt to refer to numpy 1.10.1 since it's likely that Blocks won't care about the changes from 1.9 to 1.10.
– Daniel Renshaw