-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot install a version of tensorflow that allows me to use GPU #611
Comments
If you’re writing new code today, I recommend using That said, the packages enabling GPU usage with TensorFlow on M-series Macs still work, though they currently lag a few versions behind the latest release. You can install them as follows: system("brew install openssl readline sqlite3 xz zlib tcl-tk")
python <- reticulate::install_python("3.11") # will take a few minutes; have patience
reticulate::virtualenv_create(
envname = "r-tensorflow",
python = python,
packages = c("tensorflow-macos", "tensorflow-metal"),
force = TRUE
)
# rstudioapi::restartSession() After this, restart the R session ( |
Thanks so much! Just so i understand correctly, if i am using keras3 to fit my model it will use GPU acceleration automatically? Is there anyway i can verify that this is what is indeed happening? |
Currently, GPU usage on macOS is not enabled by the default installer
However, after a closer look, that might be a stale warning. The remotes::install_github("rstudio/keras3")
reticulate::virtualenv_create("r-keras", "3.11", force = TRUE, packages = c(
"jax", "jax-metal", "tensorflow", "pydot", "keras>=3", "numpy"
))
# restart R session library(keras3)
use_backend("jax")
op_arange(10) # force jax to initialize
jax <- reticulate::import("jax")
jax$devices() # METAL(id=0) |
Thanks so much!! I'll give it a shot! |
Working on a Apple M1 Pro mac in RStudio. I can install everything fine but they tensorflow can't find any local GPUs so the models take a long time to fit.
For example,
library(tensorflow)
tf$config$list_physical_devices("GPU")
Give me:
list()
Session info and stuff below:
Any help is very much appreciated! Thanks!
The text was updated successfully, but these errors were encountered: