Skip to content

episode_reward does not work properly when env wrapped in SynchronousSqliteLogger #747

@nluu175

Description

@nluu175
Contributor

🐛 Bug

Here is the code I ran on Google Colab to create the environment.

env = gym.make("llvm-autophase-ic-v0")
env.reset()
env = SynchronousSqliteLogger(
    env=env,
    db_path=db_path,
)
env.reset(benchmark=benchmark_name)

and to produce the steps:

episode_reward = 0
i=0
while i<100:
    i+=1
    observation, reward, done, info = env.step(env.action_space.sample())
    if done:
        break
    episode_reward += reward
    print(f"Step {i}, quality={episode_reward:.3%}")

Following the above code snippets will always return episode_reward equals to 0 for every step.
However, the environment works normally when removing SynchronousSqliteLogger wrapper.

Activity

added this to the v0.2.5 milestone on Aug 9, 2022
modified the milestones: v0.2.5, v0.2.6 on Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ChrisCummins@nluu175

        Issue actions

          episode_reward does not work properly when env wrapped in SynchronousSqliteLogger · Issue #747 · facebookresearch/CompilerGym