我正在研究一个关于强化学习的项目——而且是全新的。我安装了 keras-rl 作为
pip install keras-rl
,但是它导致了许多人提到的错误:
类型错误:Keras 符号输入/输出未实现“__len__”。您可能尝试将 Keras 符号输入/输出传递到未注册调度的 TF API,从而阻止 Keras 自动将 API 调用转换为功能模型中的 lambda 层。如果您尝试直接断言符号输入/输出,也会引发此错误。
并且解决方案是使用 keras-rl2。但是,我无法在 Mac M1 上安装 keras-rl2,因为输出如下:
ERROR: Cannot install keras-rl2==1.0.0, keras-rl2==1.0.1, keras-rl2==1.0.2 、keras-rl2==1.0.3、keras-rl2==1.0.4 和 keras-rl2==1.0.5 因为这些包版本有冲突依赖关系。
当我尝试特定版本时,即
pip install keras-rl2==1.0.5
,输出为:
ERROR: Could not find a version that satisfies the required tensorflow (from keras-rl2) (from versions: none)< /code>
错误:找不到张量流的匹配分布
我通过 Apple 开发人员指南安装了tensorflow 2.6.0。知道如何安装 keras-rl2 吗?
I am working on a project on Reinforcement Learning - and completely new at this. I installed keras-rl as
pip install keras-rl
, however it caused an error as many has mentioned:
TypeError: Keras symbolic inputs/outputs do not implement `__len__`. You may be trying to pass Keras symbolic inputs/outputs to a TF API that does not register dispatching, preventing Keras from automatically converting the API call to a lambda layer in the Functional Model. This error will also get raised if you try asserting a symbolic input/output directly.
And the solution for this is to used keras-rl2. Howver I cannot install keras-rl2 on my Mac M1 as the output is following:
ERROR: Cannot install keras-rl2==1.0.0, keras-rl2==1.0.1, keras-rl2==1.0.2, keras-rl2==1.0.3, keras-rl2==1.0.4 and keras-rl2==1.0.5 because these package versions have conflicting dependencies.
When I tried a specific version, i.e
pip install keras-rl2==1.0.5
, the output is:
ERROR: Could not find a version that satisfies the requirement tensorflow (from keras-rl2) (from versions: none)
ERROR: No matching distribution found for tensorflow
I have tensorflow 2.6.0 installed by Apple Developer guide. Any idea how I can install keras-rl2?
发布评论
评论(1)
1。在M1 Macs上安装TensorFlow
2。要安装keras-rl2
打开一个终端窗口,然后从:
https:/https:/ /Github.com/keras-rl/keras-rl (最后一行更改)
setup.py脚本仍然会告诉您它找不到TensorFlow版本,但您仍然可以使用以下方式导入它:
1. To install Tensorflow on M1 Macs
https://developer.apple.com/metal/tensorflow-plugin/
2. To Install Keras-rl2
Open a terminal window and run these commands from:
https://github.com/keras-rl/keras-rl (last line changed)
The setup.py script will still tell you that it can't find a TensorFlow version but you will still be able to import it using: