Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] OpenAI gym set_level(50) not disabling logs #3267

Open
yuvalkabeli opened this issue Apr 8, 2024 · 1 comment
Open

[bug] OpenAI gym set_level(50) not disabling logs #3267

yuvalkabeli opened this issue Apr 8, 2024 · 1 comment

Comments

@yuvalkabeli
Copy link

Im running gym.logger.set_level(50) which is supposed to silence logs completely, and the logs just keep coming

Code:

import gym
    gym.logger.set_level(50)
    rgb_env = gym.make('ALE/Pong-v5', render_mode='rgb_array')
 
    ...

    done = False
    total_points = 0
    while not done:
           action = agent.get_action(stacked_state)
           next_observation, reward, terminated, truncated, info = rgb_env.step(action)

Log:
...
1/1 ━━━━━━━━━━━━━━━━━━━━ 0s 97ms/step
1/1 ━━━━━━━━━━━━━━━━━━━━ 0s 111ms/step
1/1 ━━━━━━━━━━━━━━━━━━━━ 0s 93ms/step
1/1 ━━━━━━━━━━━━━━━━━━━━ 0s 107ms/step
1/1 ━━━━━━━━━━━━━━━━━━━━ 0s 104ms/step
1/1 ━━━━━━━━━━━━━━━━━━━━ 0s 101ms/step
1/1 ━━━━━━━━━━━━━━━━━━━━ 0s 95ms/step
1/1 ━━━━━━━━━━━━━━━━━━━━ 0s 115ms/step
1/1 ━━━━━━━━━━━━━━━━━━━━ 0s 67ms/step
1/1 ━━━━━━━━━━━━━━━━━━━━ 0s 96ms/step
1/1 ━━━━━━━━━━━━━━━━━━━━ 0s 87ms/step
1/1 ━━━━━━━━━━━━━━━━━━━━ 0s 91ms/step
...

System Info
python 3.11.7
windows 10
VS code
gym==0.26.2
gym-notices==0.0.8
running the pong game in gym[atari]
gym installed trough pip insatll

@pseudo-rnd-thoughts
Copy link
Contributor

What is doing the logging? I suspect your issue is that something in your agent.get_action is logging data.
Otherwise, could you provide a reproducible example script to test with

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants