Hi I am trying to install thepackages 'tensorflow' and 'keras', but when I want to run any function of the Tensorflow's package the R studio cannot find the packages in the folder where it is supposed to be installed.

Apparently is a common error when you are using RStudio a Macbook with M1 or M2. So when I try to call this function i get always the following error (of course after installed tensorflow and eras packages and called its library):
network <- keras_model_sequential() %>%
layer_dense(units = 32, activation = "relu", input_shape = 4, name = 'dense_1') %>%
layer_dense(units = 1)

Error: Valid installation of TensorFlow not found.

Python environments searched for 'tensorflow' package:
/usr/bin/python3

Python exception encountered:
Traceback (most recent call last):
File "/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/reticulate/python/rpytools/loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
File "/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/reticulate/python/rpytools/loader.py", line 93, in _run_hook
module = hook()
File "/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/reticulate/python/rpytools/loader.py", line 117, in _hook
return find_and_load(name, import)
ModuleNotFoundError: No module named 'tensorflow'

You can install TensorFlow using the install_tensorflow() function.

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.