Skip to content

Commit ffee62d

Browse files
committed
don't install tensorflow-metal by default
1 parent c7d6853 commit ffee62d

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
- Updates for reticulate 1.41. The tensorflow R package now calls
44
`reticuate::py_require()` when it is loaded. Calling `install_tensorflow()`
55
in most circumstances is no longer necessary.
6-
- GPU usage on M-series Macs is once again enabled by default.
76
- `install_tensorflow()` installs TensorFlow v2.18 by default.
87
- Fixed an issue where GPUs would not be found when running on Windows
98
WSL Linux (reported in rstudio/keras3#1456, fixed in #599)
109
- Fixes for NumPy 2.0 (#601)
10+
- Fixes for R-devel (4.5)
1111

1212
# tensorflow 2.16.0
1313

R/install.R

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#' Install TensorFlow and its dependencies
22
#'
33
#' @description
4+
#'
45
#' Beginning with reticulate version 1.41, in most circumstances, calling the
56
#' `install_tensorflow()` function is no longer necessary, because reticulate
67
#' automatically registers python requirements with `reticulate::py_require()`
@@ -12,13 +13,16 @@
1213
#' - On Linux: if a GPU is detected: `"tensorflow[and-cuda]"`, otherwise,
1314
#' `"tensorflow-cpu"`.
1415
#'
15-
#' - On macOS: `c("tensorflow", "tensorflow-metal")`. To prevent TensorFlow usage of
16-
#' the GPU, call `reticulate::py_require("tensorflow-metal", action = "remove")`
17-
#' before reticulate has initialized Python.
16+
#' - On macOS: `"tensorflow"` is declared. The default package is not capable
17+
#' of using the GPU. To enable TensorFlow usage of the GPU, call
18+
#' `reticulate::py_require("tensorflow-metal")` before reticulate has
19+
#' initialized Python. Note that not all features of TensorFlow work correctly
20+
#' if `tensorflow-metal` is installed. There are known issues with random number
21+
#' generators like `tf$random$stateless_uniform()`, likely others as well.
1822
#'
1923
#' - On Windows: `"tensorflow"` is declared. Note that TensorFlow GPU usage on
20-
#' Windows is no longer supported. To use a GPU on windows, use TensorFlow via
21-
#' WSL.
24+
#' Windows is no longer supported (Since TensorFlow 2.10). To use a GPU on
25+
#' windows, use TensorFlow via WSL.
2226
#'
2327
#' `install_tensorflow()` creates a new virtual environment containing the
2428
#' `tensorflow` python package and it's direct dependencies. For creating a

man/install_tensorflow.Rd

Lines changed: 8 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-types.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ test_that("tf.random works", {
2424
dtype = tf$dtypes$int32)
2525
expect_s3_class(x, "tensorflow.tensor")
2626
x <- as.array(x)
27-
expect_type(x, "integer")
27+
if (!is_windows())
28+
expect_type(x, "integer")
2829
expect_identical(dim(x), 10L)
2930
})

0 commit comments

Comments
 (0)