1

I am trying to install the kerastuneR packages on Rstudio. I use the normal Cran command ("install.packages(kerastuneR)"), and it installs something, but when I run "library(kerastuneR)" I am met with:

Error: package or namespace load failed for ‘kerastuneR’:
 .onLoad falhou em loadNamespace() para 'kerastuneR', detalhes:
  chamada: py_module_import(module, convert = convert)
  erro: ModuleNotFoundError: No module named 'keras_tuner'

I tried to reinstall it all, same error. I even tried to use the google colab version for R and I had the same problem there too. Another thing I should mention is that there is a folder for kerastuneR on appdata, but I couldn't find any reference to keras_tuner anywhere.

Anyone knows what's going on ?

UPDATE:

I've tried to install the keras_tuner package using py_install, and the error message changed, now it's:

Error: package or namespace load failed for ‘kerastuneR’:
 .onLoad falhou em loadNamespace() para 'kerastuneR', detalhes:
  chamada: py_module_import(module, convert = convert)
  erro: ImportError: DLL load failed while importing _iterative: Não foi possível encontrar o módulo especificado.
Gevezo
  • 364
  • 3
  • 17
  • The error comes from Python, seems there is no `'keras_tuner'` package installed. Try open Command Prompt, and `pip install keras-tuner` should help. See there: https://stackoverflow.com/q/68188449/6574038 – jay.sf May 28 '22 at 20:14
  • I've actually tried that before, but it didn't work either. I any way, keras-tuner package goes into python dependencies, right ? Rstudio on the other hand checks for R packages. – Gevezo May 28 '22 at 21:51
  • Does you install TensorFlow >= 2.0 in your system , see **SystemRequirements** in [kerastuneR: Interface to 'Keras Tuner'](https://cran.r-project.org/web/packages/kerastuneR/index.html) – Mohamed Desouky May 28 '22 at 23:33
  • I also had tensorflow 2.0+ from previous works on Rstudio. I will check tho to see if everything is in order, but I don't think that is the cause of the problem unfortunatelly – Gevezo May 29 '22 at 01:21
  • Yep, checked everything and upgraded tensorflow to the latest version, no luck. – Gevezo May 29 '22 at 16:04

1 Answers1

0

Faced the same problem and it was fixed when I first installed the following:

  • devtools::install_github("rstudio/keras")
  • devtools::install_github("rstudio/tensorflow")
  • devtools::install_github('EagerAI/kerastuneR')

After that I loaded the libraries:

  • library(keras)
  • library(tensorflow)
  • library(kerastuneR)

And finally I install the packages running the following commands:

  • install_keras()
  • install_tensorflow()
  • install_kerastuner

Now it was successfully installed on Rstudio.

Quinten
  • 35,235
  • 5
  • 20
  • 53