The problem is not M1 or M2 (arm64) chipset. The problem is keras installation that installs tensorflow-metal, which
makes Keras to choose GPU over CPU, even if Sys.setenv("CUDA_VISIBLE_DEVICES" = -1)
is set. However, Apple's GPUs
are not supported yet by tensorflow-metal. Thus, we have to get rid of tensorflow-metal! Combined with R / RStudio, the
trick is to use a dedicated r-reticulate environment to run python and to manually uninstall tensorflow-metal again, which
is installed automatically whenever we install and load the keras package in R.
Install Anaconda for arm64 first: https://docs.anaconda.com/anaconda/install/mac-os/