Installing keras, TF, and python dependencies in base project for class' workspace in Posit Cloud

Hi @technocrat,

I tried running your code. The reticulate::install_miniconda("miniconda") was working fine, but at the end got 'Killed' with an error code of 137. I was able to install all the packages using py_install, except "tensorflow==2.9.3".

When I tried to run a neural network with the above installation, I received the following error. I could not solve it using the install_tensorflow() function.

I also noticed that the miniconda folder had python3.8, whereas the virtualenvs folder had python3.9. I am wondering if the discrepancy creates an issue, but I am not sure how to specify the version of python.

What seems to be working fine for me is the following from this post.

install.packages('reticulate')
install.packages('keras')
library(reticulate)
library(keras)
virtualenv_create("myenv")
use_virtualenv("myenv", required = TRUE)
install_keras(method="virtualenv", envname="myenv", pip_options = "--no-cache-dir")

I was able to run a basic neural network with the above installation procedure.

Thanks a lot for your time and for looking into this.

1 Like