R 中的 keras 包需要张量流,抛出错误

问题描述 投票:0回答:1

我一直在尝试在 R 中启动

keras
包:

library(reticulate)
virtualenv_create("r-reticulate", 
                  python = virtualenv_starter())
library(keras)
install_keras(envname = "r-reticulate")

但是,此代码会引发错误:

ERROR: Could not find a version that satisfies the requirement tensorflow==2.15.* (from versions: none)
ERROR: No matching distribution found for tensorflow==2.15.*
Error: Error installing package(s): "'tensorflow==2.15.*'", "tensorflow-hub", "tensorflow-datasets", "scipy", "requests", "Pillow", "h5py", "pandas", "pydot"

我尝试过各种方法来解决它。

  1. 按照这些说明,我尝试使用 Homebrew 安装,但经过几个小时的等待后不得不退出操作。
  2. 按照
  3. 此处所述从链接安装。这似乎向我的 pythonenv 添加了错误版本的 Tensorflow,因为 install_keras()
     不断抛出错误。
  4. pip install --upgrade tensorflow==2.15
    返回
    No matching distribution found for tensorflow==2.15
我以前没有使用过virtualenv,完全不知所措。我猜想解决方案可能是将 Python 从 3.12 降级,但不确定如何正确进行。我的会话信息:

R版本4.3.3 (2024-02-29) 平台:aarch64-apple-darwin20(64位) 运行环境:macOS Big Sur 11.7.10

r tensorflow keras
1个回答
0
投票
将 MacOS 更新到 Sonoma 并将 keras 更新到 keras3 就成功了。

© www.soinside.com 2019 - 2024. All rights reserved.