Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RStudio STOP-button aborts R session when Keras for R is installed #932

Closed
faltinl opened this issue Nov 17, 2019 · 1 comment
Closed

RStudio STOP-button aborts R session when Keras for R is installed #932

faltinl opened this issue Nov 17, 2019 · 1 comment
Labels

Comments

@faltinl
Copy link

faltinl commented Nov 17, 2019

When Keras for R is installed, my RStudio behaves rather unexpectedly as soon as I try to stop a running programme. My equipment behind RStudio 1.2.1335 is as follows:

sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)
Matrix products: default
locale:
[1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252
[3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C
[5] LC_TIME=German_Germany.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RevoUtils_11.0.1 RevoUtilsMath_11.0.0
loaded via a namespace (and not attached):
[1] compiler_3.5.1 tools_3.5.1

Running the following command after opening RStudio shows the preconditions given in this state:

reticulate::py_config()
python: C:...\AppData\Local\conda\conda\envs\r-reticulate\python.exe
libpython: C:/.../AppData/Local/conda/conda/envs/r-reticulate/python36.dll
pythonhome: C:...\AppData\Local\conda\conda\envs\R-RETI1
version: 3.6.9 |Anaconda, Inc.| (default, Jul 30 2019, 14:00:49) [MSC v.1915 64 bit (AMD64)]
Architecture: 64bit
numpy: C:...\AppData\Local\conda\conda\envs\R-RETI
1\lib\site-packages\numpy
numpy_version: 1.17.2
python versions found:
C:...\AppData\Local\conda\conda\envs\r-reticulate\python.exe
C:...\ANACON~3\python.exe
C:...\Anaconda3\python.exe
C:...\AppData\Local\conda\conda\envs\r-tensorflow\python.exe

Unfortunately, I am unable to locate the 4 (!) python version indicated. Although I requested to show hidden folders as well, the folders mentioned seem to remain hidden.

Running the following start-up sequence to establish my Keras environment seems to run smoothly...

library(reticulate)
use_condaenv("r-tensorflow", required = TRUE)
library(tensorflow)
library(keras)
is_keras_available()
[1] TRUE

... and as a matter of fact, I am able to run my Keras programs without problems. Repeating the two commands shown above reflect the actual state of my Keras environment:

sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)
Matrix products: default
locale:
[1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252
[3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C
[5] LC_TIME=German_Germany.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] keras_2.1.6 tensorflow_1.14.0.9000 reticulate_1.13.0-9000
[4] RevoUtils_11.0.1 RevoUtilsMath_11.0.0
loaded via a namespace (and not attached):
[1] compiler_3.5.1 R6_2.2.2 magrittr_1.5 tools_3.5.1
[5] whisker_0.3-2 base64enc_0.1-3 Rcpp_0.12.18 zeallot_0.1.0
[9] jsonlite_1.5 tfruns_1.3

reticulate::py_config()
python: C:...\AppData\Local\conda\conda\envs\r-tensorflow\python.exe
libpython: C:/.../AppData/Local/conda/conda/envs/r-tensorflow/python36.dll
pythonhome: C:...\AppData\Local\conda\conda\envs\R-TENS1
version: 3.6.6 |Anaconda, Inc.| (default, Jun 28 2018, 11:27:44) [MSC v.1900 64 bit (AMD64)]
Architecture: 64bit
numpy: C:...\AppData\Local\conda\conda\envs\R-TENS
1\lib\site-packages\numpy
numpy_version: 1.14.3
keras: C:...\AppData\Local\conda\conda\envs\R-TENS~1\lib\site-packages\keras_init_.p
NOTE: Python version was forced by use_python function

Note the differences in the reply to the reticulate-command, and the last line in particular: somehow the problem of 4 available versions of python has been resolved automatically.

Now, if I do a very simple test, namely have the following for-loop running

for (i in 1:10000000){if(i%%1000==0){cat("i=",i,", ")}}

and I press the red STOP-button offered in the right upper corner of the console, not only does the programme stop, but RStudio is aborted altogether. The same happens for any other programme, i.e. it is independent of the particular R programme running. On the other hand it doesn't happen if I do the same intervention BEFORE having run my Keras start-up sequence. Thus, there must be a connection to my Keras environment.

Thus, I strongly suspect the problem has to to with my rather awkward python-environment and I would appreciate any hints to correct that.

@faltinl
Copy link
Author

faltinl commented Jan 14, 2020

The problem, though unsolved, has become obsolete due to installation of reticulate 1.14 and ensuing new, but different problems with operating an update to keras 2.2.5.0.

I therefore suggest to close this issue.

@faltinl faltinl closed this as completed Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants