← Back to all sparks
T

tensorflow

ANALYTICS
Velocity0.0

TensorFlow for R. Contribute to rstudio/tensorflow development by creating an account on GitHub.

The R binding to TensorFlow now spends nearly every release on install plumbing.

r-packagepython-interopgpu-setupdependency-resolutionmaintenance
Current state
The R tensorflow package is a thin binding whose release notes have, for several years, been dominated by one problem: getting a working Python TensorFlow onto the user's machine. Recent releases hand that job progressively to reticulate — 2.20.0 adds py_require_tensorflow(), which makes the long-standing install_tensorflow() call unnecessary in most cases. The remaining content is version-default bumps, GPU detection fixes, and compatibility work against NumPy 2.0 and R-devel.
Where it's heading
Two arcs run through these entries. The first is dependency resolution moving from imperative (call install_tensorflow(), which builds a venv and pip-installs CUDA) to declarative (declare the requirement, let reticulate resolve it). The second is the quiet handover of the modelling layer: 2.16.0 switched the suggested high-level package from keras to keras3, leaving this package as the low-level tensor and installer surface rather than the place users spend their time.
Prediction
The next release will most likely track a TensorFlow version bump plus whatever reticulate's requirement-resolution API changes, and continue trimming install_tensorflow()'s responsibilities. The entries give no indication of new modelling capability landing here rather than in keras3.

Recent moves

  1. 11mo ago

    py_require_tensorflow() replaces manual install_tensorflow()

    The clearest step yet in handing dependency resolution to reticulate: calling py_require_tensorflow() at session start lets reticulate resolve TensorFlow, so the explicit install step most users have been performing for years is no longer needed. The rest is compatibility work — GPU detection under Windows WSL, NumPy 2.0, and R 4.5.

    View source ↗
  2. 2y ago

    Suggests keras3 over keras; auto-installs CUDA on Linux

    Switching the suggested package from keras to keras3 marks where the modelling layer moved, leaving this package as the binding and installer. Automatic CUDA installation and cudnn symlink configuration on Linux GPU machines continues the long effort to make GPU setup a non-event.

    View source ↗
  3. 2y ago

    Tracks TensorFlow 2.15 and newer reticulate

    A version-tracking release: the default installed TensorFlow moves to 2.15 and the package accepts reticulate above 1.34. No user-facing behaviour changes.

    View source ↗
  4. 2y ago

    Installs the CUDA runtime itself; only the driver is manual

    The install path takes on the NVIDIA CUDA runtime as a pip dependency, so beyond the driver no pre-existing CUDA packages are required — the biggest single reduction in GPU setup friction in this set. It also removes long-deprecated symbols and starts warning that the tfestimator generics are on the way out.

    View source ↗
  5. 2y ago

    Installs into a dedicated r-tensorflow environment by default

    Environment management gets opinionated: installs default to an r-tensorflow venv, recreated on demand, with cuDNN configured automatically when Linux GPUs are detected. Arm Macs go back to the standard TensorFlow package rather than the macos and metal variants.

    View source ↗
  6. 3y ago

    R doubles now convert to float64 tensors, not float32

    A quiet but consequential conversion change: as_tensor() coerces bare R atomic vectors to arrays first, so double vectors land as float64 rather than float32. Existing code keeps running but produces different dtypes, which is exactly the class of change that surfaces later as a numerical surprise.

    View source ↗