0

I'm trying to set up tensorflow-gpu on my local machine to train neural networks on my RTX 2070 super. Unfortunately, I get the issue of the environment failing to solve, even in a brand new environment.

I originally tried to install tensorflow-gpu directly through Anaconda, but even with cudnn and cudatoolkit installed, it wouldn't recognize the GPU. I think it may be time to jump ship for pytorch...

Error codes;

(base) C:\Users\Albert>conda install -c conda-forge cudnn
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
talonmies
  • 70,661
  • 34
  • 192
  • 269
albert chen
  • 53
  • 2
  • 6
  • [This post](https://stackoverflow.com/questions/65273118/why-is-tensorflow-not-recognizing-my-gpu-after-conda-install) and [this one](https://github.com/ContinuumIO/anaconda-issues/issues/12194) are probably relevant to you. – GZ0 Feb 07 '21 at 05:23

2 Answers2

1

The packages you are trying to install may be conflicting with your already installed packages. Try to create a new environment for tensorflow with a minimal set of packages:

conda create --name tf python cudnn -c conda-forge
conda activate tf

You can then install other packages with either conda or pip in this new environment.

In general, I find that creating separate conda environments for different tasks or projects is a better way to use conda

The conda documentation has details about managing environments

foglerit
  • 7,792
  • 8
  • 44
  • 64
  • Hello, thank you for the response. That worked for creating the environment but I still get the error after. What do you mean by creating separate environments instead of conda. Do you mean that once you virtualenv to create separate environments instead of anaconda? Thanks. – albert chen Feb 07 '21 at 03:39
  • Can you post all your steps from creating the environment to getting the error? You don't need virtualenv is you are using conda. conda creates and manages its own environments. – foglerit Feb 07 '21 at 13:23
  • @albertchen: also, make sure you are working in the new environment by activating it. I added this step to the answer – foglerit Feb 07 '21 at 13:31
  • Hello, It install cudnn fine, but when I tried to install tensorflow-gpu, it started freaking out. So Installed Tensorflow through pip and it worked out. – albert chen Feb 07 '21 at 14:12
0

It's might occour because of the version conflict, you can just uninstall the python version in the existing conda environment or simply create new Conda environment.

To Change the python version-latest on existing environment:

conda uninstall python
conda install python -y

To create a new conda env

conda create -n <env-name> python -y
conda activate <env-name>

To install conda use any of the following commands:

conda install -c conda-forge tensorflow
conda install -c conda-forge/label/broken tensorflow
conda install -c conda-forge/label/cf201901 tensorflow
conda install -c conda-forge/label/cf202003 tensorflow

reference: https://anaconda.org/conda-forge/tensorflow

Try cleaning conda cache-files in case of error

Prayash Shrestha
  • 119
  • 1
  • 1
  • 5