sjj@sjj-virtual-machine:~/sumo-rl$ python3 experiments/a3c_4x4grid.py
2021-10-25 14:00:47,456 INFO services.py:1092 -- View the Ray dashboard at http://127.0.0.1:8265
/home/sjj/.local/lib/python3.6/site-packages/gym/spaces/box.py:74: UserWarning: WARN: Box bound precision lowered by casting to float32
"Box bound precision lowered by casting to {}".format(self.dtype)
2021-10-25 14:00:50,149 INFO trainer.py:1065 -- _use_trajectory_view_api only supported for PyTorch so far! Will run w/o.
2021-10-25 14:00:50,149 INFO trainer.py:619 -- Current log_level is WARN. For more information, set 'log_level': 'INFO' / 'DEBUG' or use the -v and -vv flags.
(pid=2043) Retrying in 1 seconds
(pid=2044) Retrying in 1 seconds
(pid=2043) Step #0.00 (0ms ?RT. ?UPS, TraCI: 55ms, vehicles TOT 0 ACT 0 BUF 0)
(pid=2043) /home/sjj/.local/lib/python3.6/site-packages/pettingzoo/utils/wrappers/base.py:59: UserWarning: The action_spaces dictionary is deprecated. Use the action_space function instead.
(pid=2043) warnings.warn("The action_spaces dictionary is deprecated. Use the action_space function instead.")
(pid=2043) /home/sjj/.local/lib/python3.6/site-packages/pettingzoo/utils/env.py:89: UserWarning: Your environment should override the action_space function. Attempting to use the action_spaces dict attribute.
(pid=2043) warnings.warn("Your environment should override the action_space function. Attempting to use the action_spaces dict attribute.")
(pid=2043) /home/sjj/.local/lib/python3.6/site-packages/pettingzoo/utils/wrappers/base.py:51: UserWarning: The observation_spaces dictionary is deprecated. Use the observation_space function instead.
(pid=2043) warnings.warn("The observation_spaces dictionary is deprecated. Use the observation_space function instead.")
(pid=2043) /home/sjj/.local/lib/python3.6/site-packages/pettingzoo/utils/env.py:78: UserWarning: Your environment should override the observation_space function. Attempting to use the observation_spaces dict attribute.
(pid=2043) warnings.warn("Your environment should override the observation_space function. Attempting to use the observation_spaces dict attribute.")
(pid=2044) /home/sjj/.local/lib/python3.6/site-packages/pettingzoo/utils/wrappers/base.py:59: UserWarning: The action_spaces dictionary is deprecated. Use the action_space function instead.
(pid=2044) warnings.warn("The action_spaces dictionary is deprecated. Use the action_space function instead.")
(pid=2044) /home/sjj/.local/lib/python3.6/site-packages/pettingzoo/utils/env.py:89: UserWarning: Your environment should override the action_space function. Attempting to use the action_spaces dict attribute.
(pid=2044) warnings.warn("Your environment should override the action_space function. Attempting to use the action_spaces dict attribute.")
(pid=2044) /home/sjj/.local/lib/python3.6/site-packages/pettingzoo/utils/wrappers/base.py:51: UserWarning: The observation_spaces dictionary is deprecated. Use the observation_space function instead.
(pid=2044) warnings.warn("The observation_spaces dictionary is deprecated. Use the observation_space function instead.")
(pid=2044) /home/sjj/.local/lib/python3.6/site-packages/pettingzoo/utils/env.py:78: UserWarning: Your environment should override the observation_space function. Attempting to use the observation_spaces dict attribute.
(pid=2044) warnings.warn("Your environment should override the observation_space function. Attempting to use the observation_spaces dict attribute.")
(pid=2044) Step #0.00 (0ms ?RT. ?UPS, TraCI: 57ms, vehicles TOT 0 ACT 0 BUF 0)
Traceback (most recent call last):
File "experiments/a3c_4x4grid.py", line 38, in
"no_done_at_end": True
File "/home/sjj/.local/lib/python3.6/site-packages/ray/rllib/agents/trainer_template.py", line 106, in init
Trainer.init(self, config, env, logger_creator)
File "/home/sjj/.local/lib/python3.6/site-packages/ray/rllib/agents/trainer.py", line 477, in init
super().init(config, logger_creator)
File "/home/sjj/.local/lib/python3.6/site-packages/ray/tune/trainable.py", line 249, in init
self.setup(copy.deepcopy(self.config))
File "/home/sjj/.local/lib/python3.6/site-packages/ray/rllib/agents/trainer.py", line 630, in setup
self._init(self.config, self.env_creator)
File "/home/sjj/.local/lib/python3.6/site-packages/ray/rllib/agents/trainer_template.py", line 138, in _init
num_workers=self.config["num_workers"])
File "/home/sjj/.local/lib/python3.6/site-packages/ray/rllib/agents/trainer.py", line 707, in _make_workers
logdir=self.logdir)
File "/home/sjj/.local/lib/python3.6/site-packages/ray/rllib/evaluation/worker_set.py", line 81, in init
lambda p, pid: (pid, p.observation_space, p.action_space)))
File "/home/sjj/.local/lib/python3.6/site-packages/ray/worker.py", line 1452, in get
raise value.as_instanceof_cause()
ray.exceptions.RayTaskError(AttributeError): ray::RolloutWorker.foreach_policy() (pid=2044, ip=192.168.52.129)
File "python/ray/_raylet.pyx", line 443, in ray._raylet.execute_task
File "python/ray/_raylet.pyx", line 477, in ray._raylet.execute_task
File "python/ray/_raylet.pyx", line 481, in ray._raylet.execute_task
File "python/ray/_raylet.pyx", line 482, in ray._raylet.execute_task
File "python/ray/_raylet.pyx", line 436, in ray._raylet.execute_task.function_executor
File "/home/sjj/.local/lib/python3.6/site-packages/ray/rllib/evaluation/rollout_worker.py", line 366, in init
self.env = _validate_env(env_creator(env_context))
File "experiments/a3c_4x4grid.py", line 28, in
max_depart_delay=0)))
File "/home/sjj/.local/lib/python3.6/site-packages/ray/rllib/env/pettingzoo_env.py", line 72, in init
self.agents = self.aec_env.agents
File "/home/sjj/.local/lib/python3.6/site-packages/pettingzoo/utils/wrappers/order_enforcing.py", line 38, in getattr
raise AttributeError(f"{value} cannot be accessed before reset")
AttributeError: agents cannot be accessed before reset
I've updated the examples and added instructions on how to use stable-baselines3 with Gymnasium in the README.
Please let me know if there are more issues.
Hey,
When I run a3c_4x4grid.py, I get the error
sjj@sjj-virtual-machine:~/sumo-rl$ python3 experiments/a3c_4x4grid.py 2021-10-25 14:00:47,456 INFO services.py:1092 -- View the Ray dashboard at http://127.0.0.1:8265 /home/sjj/.local/lib/python3.6/site-packages/gym/spaces/box.py:74: UserWarning: WARN: Box bound precision lowered by casting to float32 "Box bound precision lowered by casting to {}".format(self.dtype) 2021-10-25 14:00:50,149 INFO trainer.py:1065 --
"no_done_at_end": True
File "/home/sjj/.local/lib/python3.6/site-packages/ray/rllib/agents/trainer_template.py", line 106, in init
Trainer.init(self, config, env, logger_creator)
File "/home/sjj/.local/lib/python3.6/site-packages/ray/rllib/agents/trainer.py", line 477, in init
super().init(config, logger_creator)
File "/home/sjj/.local/lib/python3.6/site-packages/ray/tune/trainable.py", line 249, in init
self.setup(copy.deepcopy(self.config))
File "/home/sjj/.local/lib/python3.6/site-packages/ray/rllib/agents/trainer.py", line 630, in setup
self._init(self.config, self.env_creator)
File "/home/sjj/.local/lib/python3.6/site-packages/ray/rllib/agents/trainer_template.py", line 138, in _init
num_workers=self.config["num_workers"])
File "/home/sjj/.local/lib/python3.6/site-packages/ray/rllib/agents/trainer.py", line 707, in _make_workers
logdir=self.logdir)
File "/home/sjj/.local/lib/python3.6/site-packages/ray/rllib/evaluation/worker_set.py", line 81, in init
lambda p, pid: (pid, p.observation_space, p.action_space)))
File "/home/sjj/.local/lib/python3.6/site-packages/ray/worker.py", line 1452, in get
raise value.as_instanceof_cause()
ray.exceptions.RayTaskError(AttributeError): ray::RolloutWorker.foreach_policy() (pid=2044, ip=192.168.52.129)
File "python/ray/_raylet.pyx", line 443, in ray._raylet.execute_task
File "python/ray/_raylet.pyx", line 477, in ray._raylet.execute_task
File "python/ray/_raylet.pyx", line 481, in ray._raylet.execute_task
File "python/ray/_raylet.pyx", line 482, in ray._raylet.execute_task
File "python/ray/_raylet.pyx", line 436, in ray._raylet.execute_task.function_executor
File "/home/sjj/.local/lib/python3.6/site-packages/ray/rllib/evaluation/rollout_worker.py", line 366, in init
self.env = _validate_env(env_creator(env_context))
File "experiments/a3c_4x4grid.py", line 28, in
max_depart_delay=0)))
File "/home/sjj/.local/lib/python3.6/site-packages/ray/rllib/env/pettingzoo_env.py", line 72, in init
self.agents = self.aec_env.agents
File "/home/sjj/.local/lib/python3.6/site-packages/pettingzoo/utils/wrappers/order_enforcing.py", line 38, in getattr
raise AttributeError(f"{value} cannot be accessed before reset")
AttributeError: agents cannot be accessed before reset
_use_trajectory_view_api
only supported for PyTorch so far! Will run w/o. 2021-10-25 14:00:50,149 INFO trainer.py:619 -- Current log_level is WARN. For more information, set 'log_level': 'INFO' / 'DEBUG' or use the -v and -vv flags. (pid=2043) Retrying in 1 seconds (pid=2044) Retrying in 1 seconds (pid=2043) Step #0.00 (0ms ?RT. ?UPS, TraCI: 55ms, vehicles TOT 0 ACT 0 BUF 0)(pid=2043) /home/sjj/.local/lib/python3.6/site-packages/pettingzoo/utils/wrappers/base.py:59: UserWarning: The
action_spaces
dictionary is deprecated. Use theaction_space
function instead. (pid=2043) warnings.warn("Theaction_spaces
dictionary is deprecated. Use theaction_space
function instead.") (pid=2043) /home/sjj/.local/lib/python3.6/site-packages/pettingzoo/utils/env.py:89: UserWarning: Your environment should override the action_space function. Attempting to use the action_spaces dict attribute. (pid=2043) warnings.warn("Your environment should override the action_space function. Attempting to use the action_spaces dict attribute.") (pid=2043) /home/sjj/.local/lib/python3.6/site-packages/pettingzoo/utils/wrappers/base.py:51: UserWarning: Theobservation_spaces
dictionary is deprecated. Use theobservation_space
function instead. (pid=2043) warnings.warn("Theobservation_spaces
dictionary is deprecated. Use theobservation_space
function instead.") (pid=2043) /home/sjj/.local/lib/python3.6/site-packages/pettingzoo/utils/env.py:78: UserWarning: Your environment should override the observation_space function. Attempting to use the observation_spaces dict attribute. (pid=2043) warnings.warn("Your environment should override the observation_space function. Attempting to use the observation_spaces dict attribute.") (pid=2044) /home/sjj/.local/lib/python3.6/site-packages/pettingzoo/utils/wrappers/base.py:59: UserWarning: Theaction_spaces
dictionary is deprecated. Use theaction_space
function instead. (pid=2044) warnings.warn("Theaction_spaces
dictionary is deprecated. Use theaction_space
function instead.") (pid=2044) /home/sjj/.local/lib/python3.6/site-packages/pettingzoo/utils/env.py:89: UserWarning: Your environment should override the action_space function. Attempting to use the action_spaces dict attribute. (pid=2044) warnings.warn("Your environment should override the action_space function. Attempting to use the action_spaces dict attribute.") (pid=2044) /home/sjj/.local/lib/python3.6/site-packages/pettingzoo/utils/wrappers/base.py:51: UserWarning: Theobservation_spaces
dictionary is deprecated. Use theobservation_space
function instead. (pid=2044) warnings.warn("Theobservation_spaces
dictionary is deprecated. Use theobservation_space
function instead.") (pid=2044) /home/sjj/.local/lib/python3.6/site-packages/pettingzoo/utils/env.py:78: UserWarning: Your environment should override the observation_space function. Attempting to use the observation_spaces dict attribute. (pid=2044) warnings.warn("Your environment should override the observation_space function. Attempting to use the observation_spaces dict attribute.") (pid=2044) Step #0.00 (0ms ?RT. ?UPS, TraCI: 57ms, vehicles TOT 0 ACT 0 BUF 0)Traceback (most recent call last): File "experiments/a3c_4x4grid.py", line 38, in
Can you please tell me how to make it work?