Can't install Tensorflow 1.14 with greta

I’m trying to install tensorflow after having installed greta using the command suggested after loading the library that is supposed to install version 1.14.

This is the error message I get:

> greta::install_tensorflow(extra_packages = "tensorflow-probability", version="1.14.0")
Using virtual environment '~/.virtualenvs/r-reticulate' ...
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting tensorflow==1.14.0
  Using cached https://files.pythonhosted.org/packages/d3/59/d88fe8c58ffb66aca21d03c0e290cd68327cc133591130c674985e98a482/tensorflow-1.14.0-cp27-cp27mu-manylinux1_x86_64.whl
Collecting tensorflow-probability
  Using cached https://files.pythonhosted.org/packages/f8/72/29ef1e5f386b65544d4e7002dfeca1e55b099ed182cd6d405c21a19ae259/tensorflow_probability-0.8.0-py2.py3-none-any.whl
Collecting grpcio>=1.8.6
  Using cached https://files.pythonhosted.org/packages/f9/9d/8ff1b609e32d2f99b3085ca73f4b25615fda68481314dd371e2dde713ff8/grpcio-1.24.1-cp27-cp27mu-manylinux1_x86_64.whl
Collecting mock>=2.0.0
  Using cached https://files.pythonhosted.org/packages/05/d2/f94e68be6b17f46d2c353564da56e6fb89ef09faeeff3313a046cb810ca9/mock-3.0.5-py2.py3-none-any.whl
Processing /home/rstudio/.cache/pip/wheels/dd/f2/5d/2689b5547f32c4e258c3b7ccbe7f1d0f2afbb84fb01e830792/Keras_Applications-1.0.8-cp27-none-any.whl
Collecting tensorboard<1.15.0,>=1.14.0
  Using cached https://files.pythonhosted.org/packages/f4/37/e6a7af1c92c5b68fb427f853b06164b56ea92126bcfd87784334ec5e4d42/tensorboard-1.14.0-py2-none-any.whl
Processing /home/rstudio/.cache/pip/wheels/d7/de/2e/efa132238792efb6459a96e85916ef8597fcb3d2ae51590dfd/wrapt-1.11.2-cp27-cp27mu-linux_x86_64.whl
Collecting protobuf>=3.6.1
  Using cached https://files.pythonhosted.org/packages/c5/49/ffa7ab9c52ec56b535cffec3bc844254c073888e6d4aeee464671ac97480/protobuf-3.10.0-cp27-cp27mu-manylinux1_x86_64.whl
Collecting keras-preprocessing>=1.0.5
  Using cached https://files.pythonhosted.org/packages/28/6a/8c1f62c37212d9fc441a7e26736df51ce6f0e38455816445471f10da4f0a/Keras_Preprocessing-1.1.0-py2.py3-none-any.whl
Processing /home/rstudio/.cache/pip/wheels/59/38/c6/234dc39b4f6951a0768fbc02d5b7207137a5b1d9094f0d54bf/gast-0.3.2-cp27-none-any.whl
Collecting wheel
  Using cached https://files.pythonhosted.org/packages/00/83/b4a77d044e78ad1a45610eb88f745be2fd2c6d658f9798a15e384b7d57c9/wheel-0.33.6-py2.py3-none-any.whl
Collecting numpy<2.0,>=1.14.5
  Using cached https://files.pythonhosted.org/packages/d7/b1/3367ea1f372957f97a6752ec725b87886e12af1415216feec9067e31df70/numpy-1.16.5-cp27-cp27mu-manylinux1_x86_64.whl
Collecting enum34>=1.1.6
  Using cached https://files.pythonhosted.org/packages/c5/db/e56e6b4bbac7c4a06de1c50de6fe1ef3810018ae11732a50f15f62c7d050/enum34-1.1.6-py2-none-any.whl
Processing /home/rstudio/.cache/pip/wheels/7c/06/54/bc84598ba1daf8f970247f550b175aaaee85f68b4b0c5ab2c6/termcolor-1.1.0-cp27-none-any.whl
Collecting six>=1.10.0
  Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Processing /home/rstudio/.cache/pip/wheels/a7/15/a0/0a0561549ad11cdc1bc8fa1191a353efd30facf6bfb507aefc/absl_py-0.8.1-cp27-none-any.whl
Collecting tensorflow-estimator<1.15.0rc0,>=1.14.0rc0
  Using cached https://files.pythonhosted.org/packages/3c/d5/21860a5b11caf0678fbc8319341b0ae21a07156911132e0e71bffed0510d/tensorflow_estimator-1.14.0-py2.py3-none-any.whl
Collecting google-pasta>=0.1.6
  Using cached https://files.pythonhosted.org/packages/35/95/d41cd87d147742ef72d5d1dc317318486e3fbffdadf24a60e70dedf01d56/google_pasta-0.1.7-py2-none-any.whl
Collecting backports.weakref>=1.0rc1
  Using cached https://files.pythonhosted.org/packages/88/ec/f598b633c3d5ffe267aaada57d961c94fdfa183c5c3ebda2b6d151943db6/backports.weakref-1.0.post1-py2.py3-none-any.whl
Collecting astor>=0.6.0
  Using cached https://files.pythonhosted.org/packages/d1/4f/950dfae467b384fc96bc6469de25d832534f6b4441033c39f914efd13418/astor-0.8.0-py2.py3-none-any.whl
Collecting decorator
  Using cached https://files.pythonhosted.org/packages/5f/88/0075e461560a1e750a0dcbf77f1d9de775028c37a19a346a6c565a257399/decorator-4.4.0-py2.py3-none-any.whl
Collecting cloudpickle==1.1.1
  Using cached https://files.pythonhosted.org/packages/24/fb/4f92f8c0f40a0d728b4f3d5ec5ff84353e705d8ff5e3e447620ea98b06bd/cloudpickle-1.1.1-py2.py3-none-any.whl
Collecting futures>=2.2.0; python_version < "3.2"
  Using cached https://files.pythonhosted.org/packages/d8/a6/f46ae3f1da0cd4361c344888f59ec2f5785e69c872e175a748ef6071cdb5/futures-3.3.0-py2-none-any.whl
Collecting funcsigs>=1; python_version < "3.3"
  Using cached https://files.pythonhosted.org/packages/69/cb/f5be453359271714c01b9bd06126eaf2e368f1fddfff30818754b5ac2328/funcsigs-1.0.2-py2.py3-none-any.whl
Collecting h5py
  Using cached https://files.pythonhosted.org/packages/12/90/3216b8f6d69905a320352a9ca6802a8e39fdb1cd93133c3d4163db8d5f19/h5py-2.10.0-cp27-cp27mu-manylinux1_x86_64.whl
Collecting setuptools>=41.0.0
  Using cached https://files.pythonhosted.org/packages/6a/9a/50fadfd53ec909e4399b67c74cc7f4e883488035cfcdb90b685758fa8b34/setuptools-41.4.0-py2.py3-none-any.whl
Collecting werkzeug>=0.11.15
  Using cached https://files.pythonhosted.org/packages/ce/42/3aeda98f96e85fd26180534d36570e4d18108d62ae36f87694b476b83d6f/Werkzeug-0.16.0-py2.py3-none-any.whl
Collecting markdown>=2.6.8
  Using cached https://files.pythonhosted.org/packages/c0/4e/fd492e91abdc2d2fcb70ef453064d980688762079397f779758e055f6575/Markdown-3.1.1-py2.py3-none-any.whl
ERROR: tensorflow-gpu 2.0.0 has requirement gast==0.2.2, but you'll have gast 0.3.2 which is incompatible.
ERROR: tensorflow-gpu 2.0.0 has requirement tensorboard<2.1.0,>=2.0.0, but you'll have tensorboard 1.14.0 which is incompatible.
ERROR: tensorflow-gpu 2.0.0 has requirement tensorflow-estimator<2.1.0,>=2.0.0, but you'll have tensorflow-estimator 1.14.0 which is incompatible.
ERROR: tensorflow-probability 0.8.0 has requirement gast<0.3,>=0.2, but you'll have gast 0.3.2 which is incompatible.
Installing collected packages: enum34, six, futures, grpcio, funcsigs, mock, numpy, h5py, keras-applications, setuptools, protobuf, werkzeug, absl-py, wheel, markdown, tensorboard, wrapt, keras-preprocessing, gast, termcolor, tensorflow-estimator, google-pasta, backports.weakref, astor, tensorflow, decorator, cloudpickle, tensorflow-probability
Successfully installed absl-py-0.8.1 astor-0.8.0 backports.weakref-1.0.post1 cloudpickle-1.2.2 decorator-4.4.0 enum34-1.1.6 funcsigs-1.0.2 futures-3.3.0 gast-0.3.2 google-pasta-0.1.7 grpcio-1.24.1 h5py-2.10.0 keras-applications-1.0.8 keras-preprocessing-1.1.0 markdown-3.1.1 mock-3.0.5 numpy-1.16.5 protobuf-3.10.0 setuptools-41.4.0 six-1.12.0 tensorboard-2.0.0 tensorflow-2.0.0 tensorflow-estimator-2.0.0 tensorflow-probability-0.8.0 termcolor-1.1.0 werkzeug-0.16.0 wheel-0.33.6 wrapt-1.11.2

Installation complete.


Restarting R session...



Failed to import TensorFlow. Please note that TensorFlow is not installed by default when you install TensorFlow Probability. This is so that users can decide whether to install the GPU-enabled TensorFlow package. To use TensorFlow Probability, please install the most recent version of TensorFlow, by following instructions at https://tensorflow.org/install.

If instead, I install tensorflow with install_tensorflow( method = "conda", extra_packages = "tensorflow-probability" ), then tensorflow 2.0 is successfully installed but, as expected, greta can’t work with 2.0 yet.

Hi! Could you please try installing the development version of greta from GitHub and following the tensorflow installation instructions it gives you. Please let me know how you get on here.

A new version of tensorflow probability was released which depends on TF2.0, so we now need to explicitly state the version of tensorflow probability to install. The latest version of greta should have the correct instructions.

That worked!

For reference, this is what I did:

# uninstall greta and tensorflow
remove.packages("greta")
remove.packages("tensorflow")

# install greta's development version
devtools::install_github("greta-dev/greta")

# load greta and copy paste the tensorflow installation instruction's given in the terminal
library(greta)

  install_tensorflow(
    method = "conda",
    version = "1.14.0",
    extra_packages = "tensorflow-probability==0.7.0"
  )

Thanks, nick!

2 Likes