Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A bug in TfEnv #58

Closed
windweller opened this issue Nov 20, 2016 · 0 comments
Closed

A bug in TfEnv #58

windweller opened this issue Nov 20, 2016 · 0 comments

Comments

@windweller
Copy link

I'm creating my own custom environment:

class MyEnv(Env):
   def __init__(self):
      super(MyEnv, self).__init__()

   @property
    def vectorized(self):
        return True

    def candy(self):
        return "there's a candy!"

env = TfEnv(normalize(MyEnv()))
print(getattr(env, 'vectorized', False))
print(env.wrapped_env.candy())

The result is weirdly False.

I really couldn't figure out why even by reading normalize() TfEnv() and ProxyEnv()'s source code. It seems like I should be able to have access to the underlying wrapped class, so I added a candy() method and call it, but it would tell me that "NormalizedEnv" object has no attribute candy.

This is weird because the first line of NormalizedEnv is:

class NormalizedEnv(ProxyEnv, Serializable):
    def __init__(
            self,
            env):
        ProxyEnv.__init__(self, env)

and for ProxyEnv it's:

class ProxyEnv(Env):
    def __init__(self, wrapped_env):
        self._wrapped_env = wrapped_env

    @property
    def wrapped_env(self):
        return self._wrapped_env

Why is this happening?

@windweller windweller changed the title A bug in TfEnv (ProxyEnv) A bug in TfEnv Nov 20, 2016
jonashen pushed a commit to jonashen/rllab that referenced this issue May 31, 2018
Allows users to log histograms to TensorBoard using the new record_histogram API.

This PR also starts organizing TensorBoard outputs into their own class.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant