我将以https://keras.io/examples/rl/ddpg_pendulum/为例
我收到一个错误
我使用的是tensorflow版本:2.10.0和健身房0.26.2
tf_prev_state = tf.expand_dims(tf.convert_to_tensor(prev_state), 0)
Exception has occurred: ValueError
Can't convert non-rectangular Python sequence to Tensor.
File "C:\Users\vlad.nanu\Documents\GitHub\ml-hub\pendulum.py", line 236, in <module>
tf_prev_state = tf.expand_dims(tf.convert_to_tensor(prev_state), 0)
ValueError: Can't convert non-rectangular Python sequence to Tensor.
1条答案
按热度按时间g9icjywg1#
阅读最新gym版本(0.26.x)的release notes,您将发现2个影响pendulum代码的突破性更改,分别涉及
env.Step
和env.Reset
。可以更改以下三行(请参见
#changed
):