gym icon indicating copy to clipboard operation
gym copied to clipboard

[Question] Can you help me with this error?

Open dhikshitha29 opened this issue 1 year ago • 1 comments

Question


AttributeError Traceback (most recent call last) in 1 env = gym.make('Blackjack-v1') 2 env.reset() ----> 3 calc_payoffs(env,1000,1000,draw_till_17_pol)

1 frames /usr/local/lib/python3.9/dist-packages/gym/core.py in getattr(self, name) 322 """Returns an attribute with name, unless name starts with an underscore.""" 323 if name.startswith("_"): --> 324 raise AttributeError(f"accessing private attribute '{name}' is prohibited") 325 return getattr(self.env, name) 326

AttributeError: accessing private attribute '_get_obs' is prohibited

dhikshitha29 avatar Mar 18 '23 16:03 dhikshitha29

Gym currently disables users from accessing "private" variables which start with an underscore, this includes _get_obs. Why do you need this function as you should just need to use env.reset() or env.step() to access the obs?

pseudo-rnd-thoughts avatar Mar 19 '23 11:03 pseudo-rnd-thoughts