Farama-Foundation / Metaworld

Collections of robotics environments geared towards benchmarking multi-task and meta reinforcement learning
https://metaworld.farama.org/
MIT License
1.28k stars 274 forks source link

env.render() returns None #487

Closed jayaramreddy10 closed 4 months ago

jayaramreddy10 commented 4 months ago

Hi,

I am trying to render image during rollout of my SAC policy on door-lock task using command: frame = env.render(mode='rgb_array')

And frame turns out to be None rather than image.

How do I get the rendered image? Do I need to add any other additional arguments in this command: frame = env.render(mode='rgb_array') ?

reginald-mclean commented 4 months ago

Hi sorry, our documentation needs to be updated. Follow the examples here: https://metaworld.farama.org/rendering/rendering/ You just need to set a render mode upon creation of the environment and then call frame = env.render()

Kallinteris-Andreas commented 4 months ago

Render mode should be set during environment initialization. Check the documentation for examples

jayaramreddy10 commented 4 months ago

Thanks , its working now