关于tf.gradients在R中启用急切执行时不支持



我正试图在R中实现Grad凸轮。我遇到了这个错误:

Error in py_call_impl(callable, dots$args, dots$keywords) : RuntimeError: tf.gradients is not supported when eager execution is enabled. Use tf.GradientTape instead.

我在网上找到了一些解决方案,但它们都使用python。我想知道如何在R版本的keras中解决这个问题。非常感谢。

这可以帮助

tf$compat$v1$disable_eager_execution()

相关内容

最新更新