Keras tensorflow problem similar to issue #104

I have already used keras and tensorflow in r. In the last days I have designed a well functioning NN with keras then I started to work on a CNN. Yesterday night I experimented some problems with the function flow_images_from_dataframe().

Trying to fix those problems I ran

reticulate::conda_install(packages= "pandas")

Then since new problems came about I ran

reticulate::conda_install(packages = "keras")

From then on problems started.
Rstudio started to abort session everytime I ran a keras command. To fix this I tried everything I could possibly find online, getting always new error codes.
Then I tried to reinstall keras and tensorflow multiple times during the day and in multiple different ways. Still When I run this:

library(keras)
library(tensorflow)
boston_housing <- dataset_boston_housing()

I get the following message:

Error: Installation of TensorFlow not found.

Python environments searched for 'tensorflow' package:
 C:\Users\mikip\Anaconda3\envs\r-reticulate\python.exe
 C:\Users\mikip\Anaconda3\python.exe
 C:\Users\mikip\AppData\Local\Programs\Python\Python36\python.exe

You can install TensorFlow using the install_tensorflow() function.
Error: Installation of TensorFlow not found.

Python environments searched for 'tensorflow' package:
 C:\Users\mikip\Anaconda3\envs\r-reticulate\python.exe
 C:\Users\mikip\Anaconda3\python.exe
 C:\Users\mikip\AppData\Local\Programs\Python\Python36\python.exe

You can install TensorFlow using the install_tensorflow() function.

Even though it should be present.

If I run this again:

boston_housing <- dataset_boston_housing()

I get:

Error: Python module tensorflow.keras was not found.

Detected Python configuration:

python:         C:/Users/mikip/Anaconda3/envs/r-reticulate/python.exe
libpython:      C:/Users/mikip/Anaconda3/envs/r-reticulate/python36.dll
pythonhome:     C:/Users/mikip/Anaconda3/envs/r-reticulate
version:        3.6.10 |Anaconda, Inc.| (default, May  7 2020, 19:46:08) [MSC v.1916 64 bit (AMD64)]
Architecture:   64bit
numpy:          C:/Users/mikip/Anaconda3/envs/r-reticulate/Lib/site-packages/numpy
numpy_version:  1.18.1
tensorflow:     C:\Users\mikip\ANACON~1\envs\R-RETI~1\lib\site-packages\tensorflow\__init__.p

python versions found: 
 C:/Users/mikip/Anaconda3/envs/r-reticulate/python.exe
 C:/Users/mikip/Anaconda3/python.exe
 C:/Users/mikip/AppData/Local/Programs/Python/Python36/python.exe

Additional information:

 reticulate::py_discover_config("tensorflow")

python:         C:/Users/mikip/Anaconda3/envs/r-reticulate/python.exe
libpython:      C:/Users/mikip/Anaconda3/envs/r-reticulate/python36.dll
pythonhome:     C:/Users/mikip/Anaconda3/envs/r-reticulate
version:        3.6.10 |Anaconda, Inc.| (default, May  7 2020, 19:46:08) [MSC v.1916 64 bit (AMD64)]
Architecture:   64bit
numpy:          C:/Users/mikip/Anaconda3/envs/r-reticulate/Lib/site-packages/numpy
numpy_version:  1.18.1
tensorflow:     C:\Users\mikip\ANACON~1\envs\R-RETI~1\lib\site-packages\tensorflow\__init__.p

python versions found: 
 C:/Users/mikip/Anaconda3/envs/r-reticulate/python.exe
 C:/Users/mikip/Anaconda3/python.exe
 C:/Users/mikip/AppData/Local/Programs/Python/Python36/python.exe


Version:1.0 StartHTML:0000000107 EndHTML:0000001211 StartFragment:0000000127 EndFragment:0000001193

> reticulate::conda_version() 
[1] "conda 4.6.14"


Version:1.0 StartHTML:0000000107 EndHTML:0000003253 StartFragment:0000000127 EndFragment:0000003235

|> reticulate::py_config() python: C:/Users/mikip/Anaconda3/envs/r-reticulate/python.exe libpython: C:/Users/mikip/Anaconda3/envs/r-reticulate/python36.dll pythonhome: C:/Users/mikip/Anaconda3/envs/r-reticulate version: 3.6.10 |Anaconda, Inc.| (default, May 7 2020, 19:46:08) [MSC v.1916 64 bit (AMD64)] Architecture: 64bit numpy: C:/Users/mikip/Anaconda3/envs/r-reticulate/Lib/site-packages/numpy numpy_version: 1.18.1 tensorflow: C:\Users\mikip\ANACON~1\envs\R-RETI~1\lib\site-packages\tensorflow\__init__.p python versions found: C:/Users/mikip/Anaconda3/envs/r-reticulate/python.exe C:/Users/mikip/Anaconda3/python.exe C:/Users/mikip/AppData/Local/Programs/Python/Python36/python.exe

I am on a tight schedule for my thesis and now I feel like I feel like I am sinking into quicksand. I would really appreciate some help.

I have never used reticulate, but i'm suspicious about you using the reticulate namespace twice, and I would think you would need to pass character vector of what to install

reticulate::conda_install("keras")

sorry, it is a typo, I will correct it.

It turnt out the version of tensorflow was not compatible with my computer I had to downgrade tensorflow to 2.1.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.