Code Monkey home page Code Monkey logo

Comments (9)

sguada avatar sguada commented on July 17, 2024 1

As @sidneyyan mentioned the simplest way is to just render in Python-Environment.
But if you want to open a feature request to be able to render on TF-Environment, please let us know.

from agents.

sibyjackgrove avatar sibyjackgrove commented on July 17, 2024

Currently, I think the recommended way is to use .render() on the original python environment created using suite_gym.load(). This is what they are doing in their Colab tutorials.

from agents.

gnperdue avatar gnperdue commented on July 17, 2024

Thanks for the suggestion! Calling .render() on the original python environment actually does the same thing as my wonky expression above, but is obviously cleaner and shorter.

It doesn't really work though - the render provided is always the same, no matter how long training went on. It also looks the same as if I call my more complex expression above with any valid batch index (they all also look the same).

Maybe there is no way to render() the TF-environment yet?... This would be a really strong feature to have - it can make evaluating performance much more intuitive.

from agents.

sibyjackgrove avatar sibyjackgrove commented on July 17, 2024

My feeling is that they don't want the TF-environment to be used for rendering. They only expect it to be used during the agent training and evaluation which doesn't need rendering. Rendering is after all way in which the human user can have visual confirmation of the agent's performance. The agent sees the environment purely through state observations and rewards.

from agents.

oars avatar oars commented on July 17, 2024

@sibyjackgrove Is somewhat correct. It wasn't because we didn't want people to render through the TF-Env, however I tried this today and some of the environments have issues rendering when done in the wrapped tf_environment as the rendering could be triggered outside of the main thread which OpenGL doesn't like in general.

@gnperdue Do you have a specific environment or example we could look at where your rendering isn't changing when you call the wrapped python env?

As mentioned above, we normally render directly from the python env.

from agents.

gnperdue avatar gnperdue commented on July 17, 2024

Hmmm... well, if I try with OpenAI Gym 'CartPole-v0', the environment is not repeating, but with my custom Gym environment it is. Let me dig and see if the problem isn't in my code... (I'm returning a Matplotlib figure instead of an rgb array, so maybe that is part of the issue.)

Thanks for all the comments!

from agents.

oars avatar oars commented on July 17, 2024

Sounds good. Make sure the state of your env is changing as you step it. Best of luck and feel free to open up a new issue if there's something we can help with.

from agents.

grizzlybearg avatar grizzlybearg commented on July 17, 2024

@gnperdue Hi, did you ever find a way to render your environment?

from agents.

gnperdue avatar gnperdue commented on July 17, 2024

@grizzlybearg I don't think so (memory is hazy on exactly what I was working on back than), but that's okay. I worked around... thanks for checking in.

from agents.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.