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

Juputer notebook Kernel Dead After running any gym method #3252

Open
1 task done
AasheeshLikePanner opened this issue Dec 7, 2023 · 0 comments
Open
1 task done

Comments

@AasheeshLikePanner
Copy link

Describe the bug
The bug is when i run the code it show's me the kernel is dead and restarting the main issue i found is the env method i created and running any gym method like env.render or env.action_space.sample() or env.close(). After I comment all this code or line then the code running fine but after running it without comment kernel will dead.

Code

import gym
from stable_baselines3 import PPO
from stable_baselines3.common.vec_env import DummyVecEnv
from stable_baselines3.common.evaluation import evaluate_policy
from IPython.display import display, clear_output


enviroment_name = 'CartPole-v1'
env = gym.make(enviroment_name, render_mode = 'human')

episodes = 5
for episodes in range(1, episodes + 1):
    state = env.reset()
    done = False
    score = 0
    
    while not done:
        env.render()
        action = env.action_space.sample()
        n_state, reward, truncate, done, info = env.step(action)
        score += reward
    print('Episode:{} Score:{}'.format(episodes,score))
env.close()

Also console showing this:

KernelRestarter: restarting kernel (1/5), keep random ports
WARNING:root:kernel a23dd0d8-4dd7-4aac-a008-8736e29ab8c1 restarted
0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.

System Info
i installed gym as pip install gym
Describe the characteristic of your environment:
i my enviroment i installed tensorflow and pytorch and most of the other things also cude is enabled in my enviroment.

  • Describe how Gym was installed (pip, docker, source, ...)
  • pip
  • What OS/version of Linux you're using. Note that while we will accept PRs to improve Window's support, we do not officially support it.
  • I am using linux mint

Additional context
I have checked the issue but still my problem isn't solved.

Checklist

  • I have checked that there is no similar issue in the repo (required)
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

1 participant