G'day guys,
I have just stumbled across coax today and wanted to run the examples. However, an assert statement in the generate_gif function was unable to pass (see #37). The problem could be isolated to only Atari environments, which do return None for the render_mode. Perhaps due to this change: https://github.com/openai/gym/blob/6a04d49722724677610e36c1f92908e72f51da0c/gym/envs/registration.py#L631 where the internal representation is automatically set to None if it does only work with the compatibility layer.
I changed the assertion to work onto the datatype which should always be an np.ndarray for the env.render_mode = 'rgb_array', and also differentiates from env.render_mode = 'rgb_array_list' which returns a list[np.ndarray].
This is only a minor problem but could solve some issues for people who want to try out the package and try the notebooks first.
G'day guys, I have just stumbled across coax today and wanted to run the examples. However, an assert statement in the generate_gif function was unable to pass (see #37). The problem could be isolated to only Atari environments, which do return None for the render_mode. Perhaps due to this change: https://github.com/openai/gym/blob/6a04d49722724677610e36c1f92908e72f51da0c/gym/envs/registration.py#L631 where the internal representation is automatically set to None if it does only work with the compatibility layer.
I changed the assertion to work onto the datatype which should always be an
np.ndarray
for theenv.render_mode = 'rgb_array'
, and also differentiates fromenv.render_mode = 'rgb_array_list'
which returns alist[np.ndarray]
.This is only a minor problem but could solve some issues for people who want to try out the package and try the notebooks first.
Hope this helps. – Ben
Edit: This is the link to the test notebook: https://github.com/benjaminbeilharz/coax/blob/main/doc/_notebooks/atari/dqn.ipynb