So, after much wrangling (and it is certainly a symptom of madness of wanting to setup not one but two versions of TF on one machine in this day and age), the solution I found to work was:

  • in the main, TF 2.3 environment, follow the steps described here, except for two tweaks:
    • DO NOT INSTALL TENSORFLOW YET.
    • currently (October 2020) sudo apt-get install --no-install-recommends cuda-10-1 does not work any longer, but conda install cudatoolkit=10.1.243 does, see this;
    • OTHER CAVEAT I also notice that TF 2.3 could not find the whole array of libraries (libcublas.so.10, libcufft.so.10, libcurand.so.10, etc.) until I installed cuda 10.2… conda install cudatoolkit=10.2.89, which I’ve seen people talk about here, so unclear that this is the perfect solution (other people symlink the files, or copy them manually from one dir to another, those hellish days will be remembered;
    • (another option, without TensorRT, but very useful for purging cuda and nvidia things, and fail-safe, can be found here)
  • after all the libraries, cuda, etc., are installed (you need a reboot at this point, and you can check that your gpu(s) are visible using nvidia-smi, create a fresh environment, and install TF 1.4 using the anaconda channel (conda-forge failed for me): conda install tensorflow-gpu=1.14.
  • finally, at the very end, go back to the main env and install tensorflow with pip.

In there, you should have this:

$ conda list | grep tensop tensor
tensorboard               1.14.0           py37hf484d3e_0    anaconda
tensorflow                1.14.0          gpu_py37h74c33d7_0    anaconda
tensorflow-base           1.14.0          gpu_py37he45bfe2_0    anaconda
tensorflow-estimator      1.14.0                     py_0    anaconda
tensorflow-gpu            1.14.0               h0d30ee6_0    anaconda

And, importantly:

$ pip freeze | grep tensor
tensorboard==1.14.0
tensorflow==1.14.0
tensorflow-estimator==1.14.0

This does not work if you installed TF with pip beforehand.

After that, activate your other base env, and complete your installation with pip

$ pip install tensorflow

Which should give you:

$ conda list | grep tenso tensor
tensorboard               2.3.0                    pypi_0    pypi
tensorboard-plugin-wit    1.7.0                    pypi_0    pypi
tensorflow                2.3.1                    pypi_0    pypi
tensorflow-estimator      2.3.0                    pypi_0    pypi

And:

$ pip freeze | grep tensor
tensorboard==2.3.0
tensorboard-plugin-wit==1.7.0
tensorflow==2.3.1
tensorflow-estimator==2.3.0

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top