mirror of
https://github.com/wassname/ray.git
synced 2026-07-27 11:26:41 +08:00
[rllib] Fix Preprocessor for ATARI (#1066)
* Removing squeeze, fix atari preprocessing * nit comment * comments * jenkins * Lint
This commit is contained in:
@@ -99,15 +99,13 @@ class Policy:
|
||||
t = 0
|
||||
if save_obs:
|
||||
obs = []
|
||||
# TODO(ekl) the squeeze() is needed for Pong-v0, but we should fix
|
||||
# this in the preprocessor instead
|
||||
ob = preprocessor.transform(env.reset()).squeeze()
|
||||
ob = preprocessor.transform(env.reset())
|
||||
for _ in range(timestep_limit):
|
||||
ac = self.act(ob[None], random_stream=random_stream)[0]
|
||||
if save_obs:
|
||||
obs.append(ob)
|
||||
ob, rew, done, _ = env.step(ac)
|
||||
ob = preprocessor.transform(ob).squeeze()
|
||||
ob = preprocessor.transform(ob)
|
||||
rews.append(rew)
|
||||
t += 1
|
||||
if render:
|
||||
|
||||
Reference in New Issue
Block a user