kerasR给出错误 [英] kerasR giving error

查看:218
本文介绍了kerasR给出错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用kerasR进行R中的深度学习.我正在尝试重现该包中的示例.尝试以下代码会产生错误:

I am trying to use kerasR for deep learning in R. I am trying to reproduce the examples in the package. Trying the following code produces error:

library(kerasR)
mod <- Sequential()

错误是:

Error in Sequential() : attempt to apply non-function

推荐答案

我建议在KerasR Github存储库中查看此问题: https://github.com/statsmaths/kerasR/issues/1

I'd suggest to look at this issue in KerasR Github repo: https://github.com/statsmaths/kerasR/issues/1

基本上,您应该检查python版本的位置,然后使用reticulate :: use_python("PATH_TO_PYTHON")告诉系统在哪里可以找到Python.

Basically you should check where is located your version of python and then use reticulate::use_python("PATH_TO_PYTHON") to tell the system where to find Python.

当心!
每个会话只能加载一个Python解释器,如果已经有已加载的解释器,则use_python()函数不会警告您.
此外,如果您运行py_config(),它将自动加载他找到的第一个解释器(在您的情况下,似乎是错误的!),因此最好在其他任何东西之前调用reticulate :: use_python("PATH_TO_PYTHON") .

Watch Out!
You can load just one Python interpreter per session and the use_python() function doesn't warn you if there already is a loaded interpreter.
Moreover if you run py_config() it automatically loads the first interpreter that he finds (which, in your case, seems to be the wrong one!), thus you'd better call reticulate::use_python("PATH_TO_PYTHON") before anything else.

这篇关于kerasR给出错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆