python - 在 R 中运行 Keras 顺序模型
问题描述
我正在创建一个神经网络模型,我想keras_sequential_model()
在 R Studio 中运行。我已经使用命令安装了张量流install_tensorflow()
。但是,当我运行keras_sequential_model()
构建模型时,它会返回一个全局环境,而不是我可以编译的模型。我在控制台中打印了以下内容:
2021-06-02 10:26:06.287327: I tensorflow/compiler/jit/xla_cpu_device.cc:41] Not creating XLA devices, tf_xla_enable_xla_devices not set
2021-06-02 10:26:06.291491: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'nvcuda.dll'; dlerror: nvcuda.dll not found
2021-06-02 10:26:06.292624: W tensorflow/stream_executor/cuda/cuda_driver.cc:326] failed call to cuInit: UNKNOWN ERROR (303)
2021-06-02 10:26:06.293598: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:169] retrieving CUDA diagnostic information for host: iFeanyiPC
2021-06-02 10:26:06.294593: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:176] hostname: iFeanyiPC
2021-06-02 10:26:06.298435: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2021-06-02 10:26:06.302191: I tensorflow/compiler/jit/xla_gpu_device.cc:99] Not creating XLA devices, tf_xla_enable_xla_devices not set
如何解释这一点以及我做错了什么?
解决方案
老实说,我在 ML 任务中使用了 python,我建议你尝试一下。至于您的问题,我建议您查看此示例https://tensorflow.rstudio.com/guide/keras/,因为逐步解释了如何执行此操作。此外,尝试使用 google colab,因为这可能是您的桌面问题,而不是您的代码。
推荐阅读
- android-studio - 启动 Androir Studio 3.0.1 时出现模拟器错误
- php - 点击广告后如何在页面上发送用户
- java - Jersey Http Server:为每个 http 方法添加参数
- netlogo - Netlogo:[ifelse] 命令/预期命令
- haskell - 为什么我不能在 Stack 项目中使用 Text.Regex?
- javascript - 动态创建多维javascript对象
- python - 如何在转换为 Dataframe 之前展平复杂的 json
- c# - 带有 ASP.NET Core 2.2 的 Razor 页面中的嵌套/子区域
- maven - 未生成黄瓜报告
- java - 如何将对象(在这种情况下为双精度)从片段传递到公共类?