conda update downgrading TensorFlow from GPU to MKL

Question:

I have created an environment and installed TensorFlow with the command:

conda install -c anaconda tensorflow=*=gpu_py310h5ade2b3_0 cudatoolkit cudnn

And it installs the latest TensorFlow version available on the anaconda channel.
The output of conda info below:


     active environment : tensorflow
    active env location : C:ProgramDatascoopappsminiconda3currentenvstensorflow
            shell level : 1
       user config file : C:UsersOtávio Augusto Silva.condarc
 populated config files : C:UsersOtávio Augusto Silva.condarc
          conda version : 22.9.0
    conda-build version : not installed
         python version : 3.9.13.final.0
       virtual packages : __cuda=11.7=0
                          __win=0=0
                          __archspec=1=x86_64
       base environment : C:ProgramDatascoopappsminiconda3current  (writable)
      conda av data dir : C:ProgramDatascoopappsminiconda3currentetcconda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:ProgramDatascoopappsminiconda3currentpkgs
                          C:UsersOtávio Augusto Silva.condapkgs
                          C:UsersOtávio Augusto SilvaAppDataLocalcondacondapkgs
       envs directories : C:ProgramDatascoopappsminiconda3currentenvs
                          C:UsersOtávio Augusto Silva.condaenvs
                          C:UsersOtávio Augusto SilvaAppDataLocalcondacondaenvs
               platform : win-64
             user-agent : conda/22.9.0 requests/2.28.1 CPython/3.9.13 Windows/10 Windows/10.0.22000
          administrator : True
             netrc file : None
           offline mode : False


But when I try to update everything by using the command conda update --all the following happens:

The following packages will be DOWNGRADED:

  tensorflow                      2.9.1-gpu_py310h5ade2b3_0 --> 2.9.1-mkl_py310h0b323c9_0 None
  tensorflow-base                 2.9.1-gpu_py310h9761872_0 --> 2.9.1-mkl_py310h6a7f48e_0 None

The question is, how do I prevent conda update from downgrading TensorFlow and keep the GPU version?

Answers:

By using the command conda update --all tensorflow==2.9.1=gpu_py310* I can update the packages normally and maintain the TensorFlow with GPU-enabled build.

Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.