How do I install tensorflow 2.4> on anaconda?

Viewed 17226

The conda install is only for tf 2.2.0 as there doesn't seem to be a cudnn 8.0 on anaconda.

https://anaconda.org/anaconda/tensorflow-gpu

Does anyone know of a method of getting tf 2.4>= running within an anaconda environment?

3 Answers

As of June 2021, you can use the standard conda installation for 2.4:

conda install tensorflow-gpu==2.4.1

As @theastronomist mentioned, it is good to use conda search tensorflow to find which versions are enabled.

Currently conda doesn't support installing tf>2.3.0

$ conda search tensorflow

...
tensorflow                     2.2.0 mkl_py37h6e9ce2d_0  pkgs/main           
tensorflow                     2.2.0 mkl_py38h6d3daf0_0  pkgs/main           
tensorflow                     2.3.0 eigen_py37h189e6a2_0  pkgs/main           
tensorflow                     2.3.0 eigen_py38h71ff20e_0  pkgs/main           
tensorflow                     2.3.0 mkl_py37h0481017_0  pkgs/main           
tensorflow                     2.3.0 mkl_py38hd53216f_0  pkgs/main

BTW conda-gpu only supports up to 2.2.0 on conda

As previous answers mentioned, you can install using pip install tensorflow while inside your conda environment.

As you mentioned the issue regarding CUDA also, I assume you want to upgrade tensorflow to match up the CUDA version with tf version. I think your cuda version is 11.x.

There are two solutions, first, you can uninstall CUDA drivers, install 10.x and then use tf 2.3. This will support gpu based tensor operations. In this case, you also have to downgrade tf in other environments (e.g. conda env in Pycharm IDE) because CUDA 10. will not supprot the downgraded tf versions.

Or you can wait till anaconda supports tf 2.4. In that case, you dont need to change anything anywhere. Just wait, install tf 2.4 in your conda env and use gpu with tensor operations.

Related