KerasR error

I am trying to use kerasR for deep learning in R. I am trying to reproduce examples in a package. When trying to execute the following code, an error occurs:

library(kerasR)
mod <- Sequential()

      

Mistake:

Error in Sequential() : attempt to apply non-function

      

+3


source to share


1 answer


I would suggest looking at this issue on the KerasR Github repository: https://github.com/statsmaths/kerasR/issues/1

Basically you have to check where your python version is and then use reticulate :: use_python ("PATH_TO_PYTHON") to tell the system where to find Python.



Beware!
You can only load one Python interpreter per session, and the use_python () function does not warn you if there is already an interpreter loaded.
Moreover, if you run py_config (), it will automatically load the first interpreter it finds (which seems wrong in your case!), So you better call grid :: use_python ("PATH_TO_PYTHON") before anything else.

+2


source







All Articles