Skip to content

Reinforcement demo issue #10

Closed
Closed
@brad0taylor

Description

@brad0taylor

When I run the following line in the cart-pole demo using pytorch 0.1.6 - I get the following error:

plt.imshow(get_screen().squeeze(0).permute(1, 2, 0).numpy(), interpolation='none')

/home/brad/anaconda3/lib/python3.5/site-packages/gym/envs/classic_control/cartpole.py in _render(self, mode, close)
    135             self.viewer.add_geom(self.track)
    136 
--> 137         x = self.state
    138         cartx = x[0]*scale+screen_width/2.0 # MIDDLE OF CART
    139         self.carttrans.set_translation(cartx, carty)

AttributeError: 'CartPoleEnv' object has no attribute 'state'

however the rest of the demo seems to work ok

Also I had to insert 'import torch' in order to avoid a downstream error.

Lovely fun demo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions