Why is Tensorflow not recognizing my GPU after conda install?
The tensorflow
build automatically selected by Anaconda on Windows 10 during the installation of tensorflow-gpu
2.3 seems to be faulty. Please find a workaround here (consider upvoting the GitHub answer if you have a GitHub account).
Windows only:
Python 3.7: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py37h936c3e2_0
Python 3.8: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py38h1fcfbd6_0
@geometrikal solution almost worked for me. But in between installing tensorflow-gpu with conda and installing tensorflow 2.3 with pip, I needed to uninstall the tensorflow parts of the package tensorflow-gpu to avoid conistency warnings by pip. Conda would have uninstalled the whole package. I know Conda does not recommend mixing pip with conda but this is the solution worked that worked and I am tired of spending another day with this issue.
conda create -n tfgpu python=3.7
conda activate tfgpu
conda install tensorflow-gpu=2.1
pip uninstall tensorflow
pip uninstall tensorflow-estimator
pip uninstall tensorboard
pip uninstall tensorboard-plugin-wit
pip install tensorflow==2.3
pip check
August 2021 Conda install may be working now, as according to @ComputerScientist in the comments below, conda install tensorflow-gpu==2.4.1
will give cudatoolkit-10.1.243
and cudnn-7.6.5
The following was written in Jan 2021 and is out of date
Currently conda install tensorflow-gpu
installs tensorflow v2.3.0 and does NOT install the conda cudnn or cudatoolkit packages. Installing them manually (e.g. with conda install cudatoolkit=10.1
) does not seem to fix the problem either.
A solution is to install an earlier version of tensorflow, which does install cudnn and cudatoolkit, then upgrade with pip
conda install tensorflow-gpu=2.1
pip install tensorflow-gpu==2.3.1
(2.4.0 uses cuda 11.0 and cudnn 8.0, however cudnn 8.0 is not in anaconda as of 16/12/2020)
Edit: please also see @GZ0's answer, which links to a github discussion with a one-line solution