-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[RLlib] Getting Started first example executed with TF2, is followed by an error #45821
Comments
This can probably be fixed easily. Looks similar to this: #45562 |
I think I ran into the same error. Versions / Dependencies import gymnasium as gym
import ray
from ray import tune
from ray.rllib.algorithms.ppo import PPOConfig
class CartPoleEnv(gym.Env):
def __init__(self, config):
self.env = gym.make("CartPole-v1")
self.action_space = self.env.action_space
self.observation_space = self.env.observation_space
def reset(self):
return self.env.reset()
def step(self, action):
return self.env.step(action)
ray.init()
config = (
PPOConfig()
.environment(CartPoleEnv)
.framework("tf2")
.training(model={"use_lstm": True})
)
tune.run(
"PPO",
config=config.to_dict(),
stop={"training_iteration": 1},
)
ray.shutdown() Error 2024-07-18 18:28:56,348 INFO worker.py:1779 -- Started a local Ray instance. View the dashboard at 127.0.0.1:8265 View detailed results here: /home/user/ray_results/PPO_2024-07-18_18-28-57 Trial status: 1 PENDING
What you should do instead is wrap
During handling of the above exception, another exception occurred: ray::PPO.init() (pid=29645, ip=192.168.1.58, actor_id=deea0a06320955d8b84b3e7e01000000, repr=PPO)
What you should do instead is wrap
Trial PPO_CartPoleEnv_8a5aa_00000 errored after 0 iterations at 2024-07-18 18:29:04. Total running time: 6s Trial status: 1 ERROR Number of errored trials: 1 Traceback (most recent call last): |
What happened + What you expected to happen
I tried the getting started commands at https://docs.ray.io/en/latest/rllib/rllib-training.html
With
pip install tensorflow[and-cuda]
followed bypip install "ray[rllib]"
.Then I tried the example:
rllib train --algo DQN --env CartPole-v1 --framework tf2 --stop '{"training_iteration": 30}'
This is followed by an ValueError instead of a saved checkpoint with a trained model.
Versions / Dependencies
Reproduction script
pip install tensorflow[and-cuda]
pip install "ray[rllib]"
rllib train --algo DQN --env CartPole-v1 --framework tf2 --stop '{"training_iteration": 30}'
Issue Severity
Medium: It is a significant difficulty but I can work around it.
The text was updated successfully, but these errors were encountered: