envlogger icon indicating copy to clipboard operation
envlogger copied to clipboard

tfds backend fails when env is reset with no steps

Open buckleytoby opened this issue 1 year ago • 0 comments

If you take the examples/tfds_random_agent_catch.py sample and call break right the env.reset() call, before any actions are taken, then the tfds backend will fail with error message:

Exception has occurred: ValueError
Failed to encode example:
In <Dataset> with name "steps":
In <Tensor> with name "reward":
Dtype object do not match float64
{'steps': [{'action': array(0, dtype=object), 'discount': array(0, dtype=object), 'is_first': True, 'is_last': False, 'is_terminal': False, 'observation': array([[0., 0., 0., 1., 0.],
       [0., 0., 0., 0., 0.],
       [0., 0., 0., 0., 0.],
       [0., 0., 0., 0., 0.],
       [0., 0., 0., 0., 0.],
       [0., 0., 0., 0., 0.],
       [0., 0., 0., 0., 0.],
       [0., 0., 0., 0., 0.],
       [0., 0., 0., 0., 0.],
       [0., 0., 1., 0., 0.]], dtype=float32), 'reward': array(0, dtype=object), 'timestamp': 1708228227.9312475}]}

buckleytoby avatar Feb 18 '24 03:02 buckleytoby