How could I update PyTorch from 1.4 -> 1.5 using Anaconda either through terminal or navigator?
Updating Anaconda with conda update --all updated some of the packages, not all, PyTorch included.
Initially, I installed PyTorch by running conda install -c pytorch pytorch
From PyTorch Github page there's the command
conda install -c pytorch magma-cuda90 # or [magma-cuda92 | magma-cuda100 | magma-cuda101 ] depending on your cuda version
but I wonder if there's going to be any kind of conflict between the already installed version and this one.
Thanks
PyTorch latest stable release (as of April 06, 2020) is still 1.4, as you can see here.
Therefore, if you want to install the nightly build (which is on track to the 1.5) using conda, you can follow the official instructions:
Cuda 10.1:
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch-nightly -c defaults -c conda-forge
Cuda 9.2:
conda install pytorch torchvision cudatoolkit=9.2 -c pytorch-nightly -c defaults -c conda-forge -c numba/label/dev
or the CPU-only version:
conda install pytorch torchvision cpuonly -c pytorch-nightly -c defaults -c conda-forge
Or, you can just wait 1.5 to be an stable release (currently, we are in the release candidate 2) and update the pytorch package as you'd have done otherwise.
Be aware that:
PyTorch 1.4 is the last release that supports Python 2
So, if you're moving to PyTorch 1.5, say goodbye to Python 2 (Yay!!).
Related
Till Apr26th, 2022, CUDA has updated to version 11.6, which can be installed by Nvidia Instruction:
wget https://developer.download.nvidia.com/compute/cuda/11.6.2/local_installers/cuda_11.6.2_510.47.03_linux.run
sudo sh cuda_11.6.2_510.47.03_linux.run
I guess the version of cudatoolkit will also be 11.6
However, there is no version of pytorch that matches CUDA11.6.
On the website of pytorch, the newest CUDA version is 11.3, pytorch version will be 1.11.0(stable)
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
So if I used CUDA11.6 and pytorch1.11.0 with cudatoolkit=11.3, will it perform normally?
and if there is any difference between Nvidia Instruction and conda method below?
conda install cuda -c nvidia
Best regards!
It should be fine. Otherwise, I saw here that you can build it from the source (I have python=3.8.13) build instructions
pip install torch --pre --extra-index-url https://download.pytorch.org/whl/nightly/cu116
I am trying to run a python script on g-cloud. The script is seemingly incompatible with tensorflow > 2.3, so I wanted to run it using tensorflow 2.2.
For that, I created a new g-cloud instance, used miniconda as an installer and created my environment with
conda create -n my_env tensorflow=2.2
Then, I tried to run the program and had to additionally install tensorflow-addons, which I did using conda install -c esri tensorflow-addons. When I run conda list -n my_env tensorflow, I get:
tensorflow 2.2.0 mkl_py38h6d3daf0_0
tensorflow-addons 0.13.0 py38_1 esri
tensorflow-base 2.2.0 mkl_py38h5059a2d_0
tensorflow-estimator 2.5.0 pyh7b7c402_0
tensorflow-gpu 2.5.0
However, when I run python -c "import tensorflow as tf; print(tf.__version__)))", I get 2.5.0 as output.
I don't really understand how this is possible, can anyone help me fix that?
I simply want to run my script example.py using tensorflow 2.2
Has anyone successfully tried installing fbprophet on anaconda?
When i try to install it, i get an incompatibility error.
I'd be very surprised if there isn't fbprophet for python 3.7 +
UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:
Specifications:
fbprophet -> python[version='2.7.|3.5.|3.6.*']
Your python: python=3.7
If python is on the left-most side of the chain, that's the version you've asked
for.When python appears to the right, that indicates that the thing on the left is s
omehow not available for the python version you are constrained to. Note that conda wil
l not change your python version to a different minor version unless you explicitly sp
ecify that.
There is a version for python 3.7, and I am able to install successfully. Can you try to use conda-forge and defaults channels together and see if it is available?
conda install fbprophet -c conda-forge -c defaults --override-channels
I had problems when using -c conda-forge only, so i suspect the necessary compatible packages are spread across different channels/locations.
These are the versions that are compatible with Python 3.7:
(ds_tensorflow) >>conda search fbprophet -c conda-forge -c defaults --override-channels | grep py37
fbprophet 0.5 py37h6538335_0 conda-forge
fbprophet 0.5 py37h6538335_1 conda-forge
fbprophet 0.5 py37h6538335_2 conda-forge
fbprophet 0.5 py37h6538335_3 conda-forge
fbprophet 0.6 py37h6538335_0 conda-forge
I have managed to fix this. I downloaded the fbprophet zipped package for Windows from the github repo, extracted the contents and launched anaconda, cd to condabin, then ran pip install specifying the path to the package folder.
Hope this helps anyone stuck in the same situation !!!
Regards,
Ochen
I have a conda environment on my Ubuntu 16.04 system.
When I install Pytorch using:
conda install pytorch
and I try and run the script I need, I get the error message:
raise AssertionError("Torch not compiled with CUDA enabled")
From looking at forums, I see that this is because I have installed Pytorch without CUDA support.
I then tried:
conda install -c pytorch torchvision cudatoolkit=10.1 pytorch
but now I get the error:
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
File "/home/username/miniconda3/envs/super_resolution/lib/python3.6/site-packages/torch/__init__.py", line 81, in <module>
from torch._C import *
ImportError: /lib64/libc.so.6: version `GLIBC_2.14' not found
So it seems that these two installs are installing different versions of Pytorch(?). The first one that seemed to work was Pytorch 1.3.1.
My question: How do I install Pytorch with CUDA enabled, but ensure it is version 1.3.1 so that it works with my system?
Given that your system is running Ubuntu 16.04, it comes with glibc installed. You can check your version by typing ldd --version.
Keep in mind that PyTorch is compiled on CentOS which runs glibc version 2.17.
Then check the CUDA version installed on your system nvcc --version
Then install PyTorch as follows e.g. if your cuda version is 9.2:
conda install pytorch torchvision cudatoolkit=9.2 -c pytorch
If you get the glibc version error, try installing an earlier version of PyTorch.
If neither of the above options work, then try installing PyTorch from sources.
If you would like to set a specific PyTorch version to install, please set it as <version_nr> in the below command:
conda install pytorch=<version_nr> torchvision cudatoolkit=9.2 -c pytorch
For CUDA 10.1:
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
For CUDA 9.2:
conda install pytorch torchvision cudatoolkit=9.2 -c pytorch
For no CUDA:
conda install pytorch torchvision cpuonly -c pytorch
Not sure whether you have solved your problem or not, but I have this exact same problem before because I was trying to install pytorch on a cluster and I don't have root access. You need to download glibc into your directoryand set the environmental variable LD_LIBRARY_PATH to your local glibc https://stackoverflow.com/a/48650638/5662642.
To install glibc locally, I will point you to this thread that I read to solve my problem
https://stackoverflow.com/a/38317265/5662642 (instead of setting --prefix=/opt/glibc-2.14 when installing, you might want to set it to other directory that you have access to). Hope it works for you
I am trying to install pytorch in Anaconda to work with Python 3.5 in Windows. Following the instructions in pytorch.org I introduced the following code in Anaconda:
pip3 install torch torchvision
But the following error came in:
Command "python setup.py egg_info" failed with error code 1 in C:\Users\sluis\AppData\Local\Temp\pip-install-qmrvz7b9\torch\
By searching on the web I found out that it may be because of setuptools being out of date but I checked and have it updated. I also tried:
conda install -c peterjc123 pytorch cuda80
But the following error arise:
The following specifications were found to be in conflict:
- pytorch
Use "conda info <package>" to see the dependencies for each package.
I also tried to load the pytorch's tar.bz2 file which I download in the following website:
anaconda.org/peterjc123/pytorch/files
And then just do:
$ conda install filename.tar.bz2
But I got the following error:
Error: HTTPError: 404 Client Error: None for url: file:///C|/Users/sluis/pytorch-0.3.1-py36_cuda80_cudnn6he774522_2.tar.bz2: file:///C|/Users/sluis/pytorch-0.3.1-py36_cuda80_cudnn6he774522_2.tar.bz2
I am quite new to this programming world so I don't really know how to dig more on the errors. Anyone knows how to get pytorch installed?
Edit: As suggested in the comments I tried:
conda install pytorch torchivsion -c pytorch
And I got the following error:
Error: Packages missing in current win-64 channels:
- pytorch
- torchvision
I did:
anaconda search -t conda torchvision
And tried to install dericlk/torchvision using the following command:
conda install -c derickl torchvision
But I am getting the same error:
Error: Package missing in current win-64 channels:
- torchvision
I couldn't find any torchvisionpackages for win-64.
conda list is giving me the following:
# packages in environment at C:\Users\aaaa\AppData\Local\Continuum\Anaconda3\envs\torchenv2:
#
mkl-include 2018.0.2 1 anaconda
certifi 2016.2.28 py35_0
cffi 1.10.0 py35_0
cmake 3.6.3 vc14_0 [vc14]
openmp 2018.0.0 intel_8 intel
mkl 2017.0.3 0
numpy 1.13.1 py35_0
pip 10.0.0 <pip>
pip 9.0.1 py35_1
pycparser 2.18 py35_0
python 3.5.4 0
pyyaml 3.12 py35_0
setuptools 36.4.0 py35_1
typing 3.6.2 py35_0
vc 14 0
vs2015_runtime 14.0.25420 0
wheel 0.29.0 py35_0
wincertstore 0.2 py35_0
zlib 1.2.11 vc14_0 [vc14]
=======
Go to the official PyTorch.org and follow the steps accordingly.
Select your preferences and you will see an appropriate command below on the page.
If you don't have GPU in the system, set CUDA as None or CPU
Example command:
conda install pytorch-cpu torchvision-cpu -c pytorch
The following worked for me. First install MKL:
conda install -c anaconda mkl
After this, install pytorch and torchvision:
conda install -c pytorch pytorch torchvision
For windows python 3.6 and above without cuda
pip install torch==1.2.0+cpu torchvision==0.4.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
Can you please try with below steps
conda create -n pytorch_env python=3.5
source activate pytorch_env
conda install -c soumith pytorch
python
> import torch
You can even find pytorch after you execute command conda list.
For linux, cuda9.0, python3.6:
pip3 install http://download.pytorch.org/whl/cu90/torch-0.3.1-cp36-cp36m-linux_x86_64.whl
pip3 install torchvision
For other cuda/python version: check website: https://ptorch.com/news/145.html
try updating the base conda package with the following command,then you can try reistalling it.
conda update --all
conda update -n base conda
For me it worked doing this:
Uninstall the previous version: go to C:\users\username\anaconda3 and run the anaconda-uninstall.exe
Install again anaconda
then run the following commands on the anaconda pompt:
conda create -n my_env python=2.7
conda activate my_env
start the gui app
conda install -c peterjc123 pytorch
anaconda-navigator
For Readers live in 2021/06/xx:
use pip3 install torch
As an update, now the Pytorch official site has the right version depending on your system:
https://pytorch.org/
I recommend using the official website for installation. Some of the previous awnsers may lead to a version that is not adequate.
After Activating conda environment
Use below command
python3 -m pip install torch torchvision
Example
(torchenv) ubuntu#user :~$ python3 -m pip install torch torchvision
Visit https://anaconda.org/pytorch/torchvision and you will find the solution
conda install -c pytorch torchvision
Try running:
conda install -c pytorch pytorch