Install native ARM R: https://cloud.r-project.org/
Install RStudio (probably preview) which is not native as of today: https://www.rstudio.com/products/rstudio/download/preview/
This blog post is helpful for getting Tensorflow working, but it is older, before the ARM version of R and the RStudio version that supports it was available.
This other blog post has specific steps outlined, but some of it has also been superseded.
Looks to me like Apple's instructions are the best as of today: https://developer.apple.com/metal/tensorflow-plugin/
Here is what I think you need to do:
- Make sure you have Python 3.8 or Python 3.9
- Install Miniforge for ARM, using
reticulate::install_miniconda()
from within R - Create conda environment for your TensorFlow install (I called it
tf_env
and have had better luck doing it from the command line) - Install packages like numpy, pandas, etc for ARM (try it with
conda install -c apple tensorflow-deps
from Apple's instructions? is that good enough?) - Install base Tensorflow (I have not tried the
tensorflow-metal
yet)
You can turn it on (in the terminal) with conda activate tf_env
and turn it off with conda deactivate
. I have this in my .Renviron
:
RETICULATE_PYTHON = "~/miniforge3/envs/tf_env/bin/python"
If you review the issue on git hub cited below you will see that I was able to successfully install tensorflow on the mac using instructions provided in the issue thread, and the issue is closed.
Unable to install tensor-flow in R-Studio on m1 mac #530