I want to use Tensorflow
package for R in Windows.
Done with Python 3.5.x installation from python.org and have installed the Tensorflow
R package from devtools::install_github("rstudio/tensorflow")
as per the official source https://rstudio.github.io/tensorflow/
I know I am not setting the environment variable in the right way in the windows and/or in the sys.setenv
function of R.
Above link says it should be set to Sys.setenv(TENSORFLOW_PYTHON="/usr/local/bin/python")
.
See below the location of my Python35 folder which includes all the python stuff including the tensorflow
library downloaded from the python side:
Python35 folder location:C:\Users\rgupta6\AppData\Local\Programs\Python\Python35
tensorflow folder location: C:\Users\rgupta6\AppData\Local\Programs\Python\Python35\Lib\site-packages\tensorflow
Code I used:
Sys.setenv(TENSORFLOW_PYTHON="C:\\Users\\rgupta6\\AppData\\Local\\Programs\\Python\\Python35")
Sys.setenv(TENSORFLOW_PYTHON="C:\\Users\\rgupta6\\AppData\\Local\\Programs\\Python\\Python35\\Lib\\site-packages\\tensorflow")
I use library(tensorflow)
and get no error.
Then I use sess = tf$Session()
and get an error:
Error in initialize_python(required_module) : Installation of Python not found, Python bindings not loaded*.
What should I do to make it work?