Tensorflow 在我的MAC M1 Air上设置深度强化学习环境

Tensorflow 在我的MAC M1 Air上设置深度强化学习环境,tensorflow,keras,deep-learning,reinforcement-learning,apple-m1,Tensorflow,Keras,Deep Learning,Reinforcement Learning,Apple M1,类型错误:Keras符号输入/输出不实现\uuuu len\uuuu。您可能试图将Keras符号输入/输出传递给未注册为dispatch的TF API,从而阻止Keras自动将API调用转换为功能模型中的lambda层。如果尝试直接断言符号输入/输出,也会引发此错误 I recently set up my MAC M1 Air to implement deep reinforcement learning. But, when I started following this tutori

类型错误:Keras符号输入/输出不实现
\uuuu len\uuuu
。您可能试图将Keras符号输入/输出传递给未注册为dispatch的TF API,从而阻止Keras自动将API调用转换为功能模型中的lambda层。如果尝试直接断言符号输入/输出,也会引发此错误

I recently set up my MAC M1 Air to implement deep reinforcement learning. 
But, when I started following this tutorial - Deep Reinforcement Learning Tutorial for Python https://www.youtube.com/watch?v=cO5g5qLrLSo&list=PLgNJO2hghbmjlE6cuKMws2ejC54BTAaWV&index=2, I got errors with DQN Agent as
 

In this part of the code.
Build Agent with Keras-RL
  from rl.agents import DQNAgent
  from rl.policy import BoltzmannQPolicy
  from rl.memory import SequentialMemory
  def build_agent(model, actions):
      policy = BoltzmannQPolicy()
      memory = SequentialMemory(limit=50000, window_length=1)
      dqn = DQNAgent(model=model, memory=memory, policy=policy, 
              nb_actions=actions, nb_steps_warmup=10, 
      target_model_update=1e-2)
      return dqn
  dqn = build_agent(model, actions)
  dqn.compile(Adam(lr=1e-3), metrics=['mae'])
  dqn.fit(env, nb_steps=50000, visualize=False, verbose=1)

请直接将代码作为文本包含在问题中,而不是作为外部链接(甚至不是作为youtube视频!)我已经编辑了它,希望它能有所帮助。对不起,我是新来的。
I searched a lot for it and they are asking to downgrade TensorFlow for its compatibility with Keras-rl2. But, I don't see any such version available for the MAC silicon chip. Can someone please guide me, I have been stuck on it for far too long.




Any help is appreciated.