Yes, I tried, but it did not work.
1.
I used
library(reticulate)
library(keras)
virtualenv_create("myenv")
install_keras(method="virtualenv", envname="myenv")
It was showing
> library(reticulate)
> library(keras)
> virtualenv_create("myenv")
virtualenv: myenv
> install_keras(method="virtualenv", envname="myenv")
Using virtual environment 'myenv' ...
Requirement already satisfied: tensorflow==2.2.0 in ./myenv/lib/python3.6/site-packages (2.2.0)
Requirement already satisfied: keras in ./myenv/lib/python3.6/site-packages (2.4.3)
Requirement already satisfied: tensorflow-hub in ./myenv/lib/python3.6/site-packages (0.11.0)
Requirement already satisfied: h5py==2.10.0 in ./myenv/lib/python3.6/site-packages (2.10.0)
Requirement already satisfied: pyyaml==3.12 in ./myenv/lib/python3.6/site-packages (3.12)
Requirement already satisfied: requests in ./myenv/lib/python3.6/site-packages (2.25.1)
Requirement already satisfied: Pillow in ./myenv/lib/python3.6/site-packages (8.1.0)
Requirement already satisfied: six in ./myenv/lib/python3.6/site-packages (from h5py==2.10.0) (1.15.0)
Requirement already satisfied: numpy>=1.7 in ./myenv/lib/python3.6/site-packages (from h5py==2.10.0) (1.19.5)
Requirement already satisfied: protobuf>=3.8.0 in ./myenv/lib/python3.6/site-packages (from tensorflow==2.2.0) (3.14.0)
Requirement already satisfied: wrapt>=1.11.1 in ./myenv/lib/python3.6/site-packages (from tensorflow==2.2.0) (1.12.1)
Requirement already satisfied: google-pasta>=0.1.8 in ./myenv/lib/python3.6/site-packages (from tensorflow==2.2.0) (0.2.0)
Requirement already satisfied: grpcio>=1.8.6 in ./myenv/lib/python3.6/site-packages (from tensorflow==2.2.0) (1.34.0)
Requirement already satisfied: tensorflow-estimator<2.3.0,>=2.2.0 in ./myenv/lib/python3.6/site-packages (from tensorflow==2.2.0) (2.2.0)
Requirement already satisfied: scipy==1.4.1 in ./myenv/lib/python3.6/site-packages (from tensorflow==2.2.0) (1.4.1)
Requirement already satisfied: keras-preprocessing>=1.1.0 in ./myenv/lib/python3.6/site-packages (from tensorflow==2.2.0) (1.1.2)
Requirement already satisfied: absl-py>=0.7.0 in ./myenv/lib/python3.6/site-packages (from tensorflow==2.2.0) (0.11.0)
Requirement already satisfied: astunparse==1.6.3 in ./myenv/lib/python3.6/site-packages (from tensorflow==2.2.0) (1.6.3)
Requirement already satisfied: termcolor>=1.1.0 in ./myenv/lib/python3.6/site-packages (from tensorflow==2.2.0) (1.1.0)
Requirement already satisfied: opt-einsum>=2.3.2 in ./myenv/lib/python3.6/site-packages (from tensorflow==2.2.0) (3.3.0)
Requirement already satisfied: wheel>=0.26 in ./myenv/lib/python3.6/site-packages (from tensorflow==2.2.0) (0.36.2)
Requirement already satisfied: tensorboard<2.3.0,>=2.2.0 in ./myenv/lib/python3.6/site-packages (from tensorflow==2.2.0) (2.2.2)
Requirement already satisfied: gast==0.3.3 in ./myenv/lib/python3.6/site-packages (from tensorflow==2.2.0) (0.3.3)
Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in ./myenv/lib/python3.6/site-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (1.7.0)
Requirement already satisfied: setuptools>=41.0.0 in ./myenv/lib/python3.6/site-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (51.1.2)
Requirement already satisfied: markdown>=2.6.8 in ./myenv/lib/python3.6/site-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (3.3.3)
Requirement already satisfied: google-auth<2,>=1.6.3 in ./myenv/lib/python3.6/site-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (1.24.0)
Requirement already satisfied: werkzeug>=0.11.15 in ./myenv/lib/python3.6/site-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (1.0.1)
Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in ./myenv/lib/python3.6/site-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (0.4.2)
Requirement already satisfied: chardet<5,>=3.0.2 in ./myenv/lib/python3.6/site-packages (from requests) (4.0.0)
Requirement already satisfied: certifi>=2017.4.17 in ./myenv/lib/python3.6/site-packages (from requests) (2020.12.5)
Requirement already satisfied: idna<3,>=2.5 in ./myenv/lib/python3.6/site-packages (from requests) (2.10)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./myenv/lib/python3.6/site-packages (from requests) (1.26.2)
Requirement already satisfied: cachetools<5.0,>=2.0.0 in ./myenv/lib/python3.6/site-packages (from google-auth<2,>=1.6.3->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (4.2.0)
Requirement already satisfied: rsa<5,>=3.1.4 in ./myenv/lib/python3.6/site-packages (from google-auth<2,>=1.6.3->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (4.7)
Requirement already satisfied: pyasn1-modules>=0.2.1 in ./myenv/lib/python3.6/site-packages (from google-auth<2,>=1.6.3->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (0.2.8)
Requirement already satisfied: requests-oauthlib>=0.7.0 in ./myenv/lib/python3.6/site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (1.3.0)
Requirement already satisfied: importlib-metadata in ./myenv/lib/python3.6/site-packages (from markdown>=2.6.8->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (3.4.0)
Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in ./myenv/lib/python3.6/site-packages (from pyasn1-modules>=0.2.1->google-auth<2,>=1.6.3->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (0.4.8)
Requirement already satisfied: oauthlib>=3.0.0 in ./myenv/lib/python3.6/site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (3.1.0)
Requirement already satisfied: zipp>=0.5 in ./myenv/lib/python3.6/site-packages (from importlib-metadata->markdown>=2.6.8->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (3.4.0)
Requirement already satisfied: typing-extensions>=3.6.4 in ./myenv/lib/python3.6/site-packages (from importlib-metadata->markdown>=2.6.8->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (3.7.4.3)
Installation complete.
Restarting R session...
-
Looks well but if I tried
model <- keras_model_sequential()
it was saying
> model <- keras_model_sequential()
Collecting tensorflow
Downloading tensorflow-2.4.0-cp36-cp36m-manylinux2010_x86_64.whl (394.7 MB)
Requirement already satisfied: wheel~=0.35 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from tensorflow) (0.36.2)
Requirement already satisfied: google-pasta~=0.2 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from tensorflow) (0.2.0)
Requirement already satisfied: absl-py~=0.10 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from tensorflow) (0.11.0)
Requirement already satisfied: h5py~=2.10.0 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from tensorflow) (2.10.0)
Requirement already satisfied: keras-preprocessing~=1.1.2 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from tensorflow) (1.1.2)
Requirement already satisfied: typing-extensions~=3.7.4 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from tensorflow) (3.7.4.3)
Requirement already satisfied: termcolor~=1.1.0 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from tensorflow) (1.1.0)
Requirement already satisfied: protobuf>=3.9.2 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from tensorflow) (3.14.0)
Requirement already satisfied: wrapt~=1.12.1 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from tensorflow) (1.12.1)
Requirement already satisfied: numpy~=1.19.2 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from tensorflow) (1.19.5)
Requirement already satisfied: gast==0.3.3 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from tensorflow) (0.3.3)
Requirement already satisfied: opt-einsum~=3.3.0 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from tensorflow) (3.3.0)
Requirement already satisfied: grpcio~=1.32.0 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from tensorflow) (1.32.0)
Requirement already satisfied: astunparse~=1.6.3 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from tensorflow) (1.6.3)
Requirement already satisfied: six~=1.15.0 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from tensorflow) (1.15.0)
Collecting flatbuffers~=1.12.0
Downloading flatbuffers-1.12-py2.py3-none-any.whl (15 kB)
Collecting tensorboard~=2.4
Downloading tensorboard-2.4.1-py3-none-any.whl (10.6 MB)
Requirement already satisfied: markdown>=2.6.8 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from tensorboard~=2.4->tensorflow) (3.3.3)
Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from tensorboard~=2.4->tensorflow) (0.4.2)
Requirement already satisfied: requests<3,>=2.21.0 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from tensorboard~=2.4->tensorflow) (2.25.1)
Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from tensorboard~=2.4->tensorflow) (1.7.0)
Requirement already satisfied: google-auth<2,>=1.6.3 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from tensorboard~=2.4->tensorflow) (1.24.0)
Requirement already satisfied: setuptools>=41.0.0 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from tensorboard~=2.4->tensorflow) (49.6.0.post20210108)
Requirement already satisfied: werkzeug>=0.11.15 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from tensorboard~=2.4->tensorflow) (1.0.1)
Requirement already satisfied: rsa<5,>=3.1.4 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from google-auth<2,>=1.6.3->tensorboard~=2.4->tensorflow) (4.7)
Requirement already satisfied: cachetools<5.0,>=2.0.0 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from google-auth<2,>=1.6.3->tensorboard~=2.4->tensorflow) (4.2.0)
Requirement already satisfied: pyasn1-modules>=0.2.1 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from google-auth<2,>=1.6.3->tensorboard~=2.4->tensorflow) (0.2.8)
Requirement already satisfied: requests-oauthlib>=0.7.0 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard~=2.4->tensorflow) (1.3.0)
Requirement already satisfied: importlib-metadata in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from markdown>=2.6.8->tensorboard~=2.4->tensorflow) (3.4.0)
Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from pyasn1-modules>=0.2.1->google-auth<2,>=1.6.3->tensorboard~=2.4->tensorflow) (0.4.8)
Requirement already satisfied: chardet<5,>=3.0.2 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from requests<3,>=2.21.0->tensorboard~=2.4->tensorflow) (4.0.0)
Requirement already satisfied: idna<3,>=2.5 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from requests<3,>=2.21.0->tensorboard~=2.4->tensorflow) (2.10)
Requirement already satisfied: certifi>=2017.4.17 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from requests<3,>=2.21.0->tensorboard~=2.4->tensorflow) (2020.12.5)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from requests<3,>=2.21.0->tensorboard~=2.4->tensorflow) (1.26.2)
Requirement already satisfied: oauthlib>=3.0.0 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard~=2.4->tensorflow) (3.1.0)
Collecting tensorflow-estimator<2.5.0,>=2.4.0rc0
Downloading tensorflow_estimator-2.4.0-py2.py3-none-any.whl (462 kB)
Requirement already satisfied: zipp>=0.5 in /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (from importlib-metadata->markdown>=2.6.8->tensorboard~=2.4->tensorflow) (3.4.0)
Installing collected packages: tensorflow-estimator, tensorboard, flatbuffers, tensorflow
ERROR: Could not install packages due to an EnvironmentError: [Errno 28] No space left on device
Error: Installation of TensorFlow not found.
Python environments searched for 'tensorflow' package:
/home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/bin/python3.6
You can install TensorFlow using the install_tensorflow() function.
then it still not working.
3.
Then I tried to use again
model <- keras_model_sequential()
it was saying:
> model <- keras_model_sequential()
Error: Python module tensorflow.keras was not found.
Detected Python configuration:
python: /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/bin/python
libpython: /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/libpython3.6m.so
pythonhome: /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate:/home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate
version: 3.6.12 |Anaconda, Inc.| (default, Sep 8 2020, 23:10:56) [GCC 7.3.0]
numpy: /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages/numpy
numpy_version: 1.19.5
P.S
This is all the code that I tried, but all of them are failed.
install.packages("remotes")
remotes::install_github("rstudio/tensorflow")
install.packages("reticulate")
library(tensorflow)
install_tensorflow(version = "2.0.0b1", method = "virtualenv", envname = "r-reticulate")
install.packages("keras")
library(keras)
library
library(tensorflow)
install_tensorflow(package_url = "https://pypi.python.org/packages/b8/d6/af3d52dd52150ec4a6ceb7788bfeb2f62ecb6aa2d1172211c4db39b349a2/tensorflow-1.3.0rc0-cp27-cp27mu-manylinux1_x86_64.whl#md5=1cf77a2360ae2e38dd3578618eacc03b")
library(tensorflow)
install_tensorflow()
library(reticulate)
library(tensorflow)
library(keras)
virtualenv_create("myenv")
install_tensorflow(method="virtualenv", envname="myenv",
package_url = "https://pypi.python.org/packages/b8/d6/af3d52dd52150ec4a6ceb7788bfeb2f62ecb6aa2d1172211c4db39b349a2/tensorflow-1.3.0rc0-cp27-cp27mu-manylinux1_x86_64.whl#md5=1cf77a2360ae2e38dd3578618eacc03b")
install_keras(method="virtualenv", envname="myenv",
package_url = "https://pypi.python.org/packages/b8/d6/af3d52dd52150ec4a6ceb7788bfeb2f62ecb6aa2d1172211c4db39b349a2/tensorflow-1.3.0rc0-cp27-cp27mu-manylinux1_x86_64.whl#md5=1cf77a2360ae2e38dd3578618eacc03b")
model <- keras_model_sequential()
library(reticulate)
library(keras)
virtualenv_create("myenv")
install_keras(method="virtualenv", envname="myenv")
use_condaenv("r-tensorflow")
install.packages('remotes')
library(remotes)
library(devtools)
devtools::install_github("rstudio/tensorflow")
devtools::install_github("rstudio/keras")
tensorflow::install_tensorflow()
tensorflow::tf_config()
virtualenv_create("myenv")
install_tensorflow(method="virtualenv", envname="myenv",
package_url = "https://pypi.python.org/packages/b8/d6/af3d52dd52150ec4a6ceb7788bfeb2f62ecb6aa2d1172211c4db39b349a2/tensorflow-1.3.0rc0-cp27-cp27mu-manylinux1_x86_64.whl#md5=1cf77a2360ae2e38dd3578618eacc03b")
install_keras(method="virtualenv", envname="myenv",
package_url = "https://pypi.python.org/packages/b8/d6/af3d52dd52150ec4a6ceb7788bfeb2f62ecb6aa2d1172211c4db39b349a2/tensorflow-1.3.0rc0-cp27-cp27mu-manylinux1_x86_64.whl#md5=1cf77a2360ae2e38dd3578618eacc03b")
model <- keras_model_sequential()
Thank you!