rstudio / tfprobability

R interface to TensorFlow Probability
https://rstudio.github.io/tfprobability/
Other
54 stars 16 forks source link

tfp and tf version mismatch #127

Closed melondonkey closed 4 years ago

melondonkey commented 4 years ago

I'm having a lot of trouble with installation and running a simple example. I have tried to manually specify the tensorflow version by install_tfprobability(tensorflow='2.1.0') but it created other problems? Shouldn't the install function select a tensorflow base that will work out of the box?

library(tfprobability)
#> Warning: package 'tfprobability' was built under R version 3.6.3
install_tfprobability()
#> 
#> Installation complete.
library(tfprobability)

d <- tfd_binomial(total_count = 7, probs = .3)
#> Error: ImportError: This version of TensorFlow Probability requires TensorFlow version >= 2.1; Detected an installation of version 2.0.0. Please upgrade TensorFlow to proceed.
#> 
#> Detailed traceback: 
#>   File "C:\Users\USER\AppData\Local\r-miniconda\envs\r-reticulate\lib\site-packages\tensorflow_probability\__init__.py", line 68, in <module>
#>     _ensure_tf_install()
#>   File "C:\Users\USER\AppData\Local\r-miniconda\envs\r-reticulate\lib\site-packages\tensorflow_probability\__init__.py", line 65, in _ensure_tf_install
#>     present=tf.__version__))

Created on 2020-03-04 by the reprex package (v0.3.0)

guzu92 commented 4 years ago

Same problem, cannot see a TensorFlow version >= 2.1 neither in CRAN nor in https://tensorflow.rstudio.com/

skeydan commented 4 years ago

Sorry, this one got overlooked...

You're right,

install_tfprobability()

should just work. As of today, it should install TensorFlow 2.1. And as soon as https://github.com/rstudio/tensorflow/pull/416 will have been merged it will :-)

Until then, please execute

install_tfprobability(tensorflow = "2.1")

instead.