Skip to content

'TimeLimit' object has no attribute 'x_threshold' error running reinforcement_q_learning.ipynb tutorial #66

Closed
@NataliaDiaz

Description

@NataliaDiaz
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-5-2f6091ee96f6> in <module>()
     37 
     38 env.reset()
---> 39 plt.imshow(get_screen().squeeze(0).permute(
     40     1, 2, 0).numpy(), interpolation='none')
     41 plt.show()

<ipython-input-5-2f6091ee96f6> in get_screen()
     19     screen = screen[:, 160:320]
     20     view_width = 320
---> 21     cart_location = get_cart_location()
     22     if cart_location < view_width // 2:
     23         slice_range = slice(view_width)

<ipython-input-5-2f6091ee96f6> in get_cart_location()
      8 
      9 def get_cart_location():
---> 10     world_width = env.x_threshold * 2
     11     scale = screen_width / world_width
     12     return int(env.state[0] * scale + screen_width / 2.0)  # MIDDLE OF CART

AttributeError: 'TimeLimit' object has no attribute 'x_threshold'

Metadata

Metadata

Assignees

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