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

running the marl_benchmarks,error:'ray.exceptions.RayTaskError(AssertionError)' #1387

Closed
Behazy opened this issue Apr 18, 2022 · 2 comments · Fixed by #1390
Closed

running the marl_benchmarks,error:'ray.exceptions.RayTaskError(AssertionError)' #1387

Behazy opened this issue Apr 18, 2022 · 2 comments · Fixed by #1390
Assignees
Labels
help wanted Extra attention is needed

Comments

@Behazy
Copy link

Behazy commented Apr 18, 2022

High Level Description
I am in the process of running the marl_benchmarks. Training and evaluation works for the decentralized paradigm.

Desired SMARTS version
0.6.0

Operating System
ubuntu 18.04

Problems
When I run the commend ' python3.8 run.py scenarios/intersections/4lane -f agents/ppo/baseline-lane-control.yaml',
'ray.exceptions.RayTaskError(AssertionError)'and' AssertionError: EndlessGoal()' happened. I read #1131, but I don't know how to solve it. I hope to get help.,thank you!

error:
Failure # 1 (occurred at 2022-04-18_16-01-30)
Traceback (most recent call last):
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/tune/trial_runner.py", line 726, in _process_trial
result = self.trial_executor.fetch_result(trial)
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/tune/ray_trial_executor.py", line 489, in fetch_result
result = ray.get(trial_future[0], timeout=DEFAULT_GET_TIMEOUT)
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/worker.py", line 1452, in get
raise value.as_instanceof_cause()
ray.exceptions.RayTaskError(AssertionError): �[36mray::PPO.train()�[39m (pid=19974, ip=192.168.79.140)
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/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/rllib/agents/trainer.py", line 517, in train
raise e
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/rllib/agents/trainer.py", line 506, in train
result = Trainable.train(self)
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/tune/trainable.py", line 336, in train
result = self.step()
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/rllib/agents/trainer_template.py", line 147, in step
res = next(self.train_exec_impl)
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/util/iter.py", line 756, in next
return next(self.built_iterator)
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/util/iter.py", line 783, in apply_foreach
for item in it:
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/util/iter.py", line 783, in apply_foreach
for item in it:
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/util/iter.py", line 843, in apply_filter
for item in it:
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/util/iter.py", line 843, in apply_filter
for item in it:
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/util/iter.py", line 783, in apply_foreach
for item in it:
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/util/iter.py", line 783, in apply_foreach
for item in it:
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/util/iter.py", line 783, in apply_foreach
for item in it:
[Previous line repeated 1 more time]
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/util/iter.py", line 876, in apply_flatten
for item in it:
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/util/iter.py", line 828, in add_wait_hooks
item = next(it)
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/util/iter.py", line 783, in apply_foreach
for item in it:
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/util/iter.py", line 783, in apply_foreach
for item in it:
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/util/iter.py", line 783, in apply_foreach
for item in it:
[Previous line repeated 1 more time]
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/util/iter.py", line 471, in base_iterator
yield ray.get(futures, timeout=timeout)
ray.exceptions.RayTaskError(AssertionError): �[36mray::RolloutWorker.par_iter_next()�[39m (pid=19975, ip=192.168.79.140)
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/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/util/iter.py", line 1152, in par_iter_next
return next(self.local_it)
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/rllib/evaluation/rollout_worker.py", line 317, in gen_rollouts
yield self.sample()
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/rllib/evaluation/rollout_worker.py", line 621, in sample
batches = [self.input_reader.next()]
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/rllib/evaluation/sampler.py", line 94, in next
batches = [self.get_data()]
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/rllib/evaluation/sampler.py", line 211, in get_data
item = next(self.rollout_provider)
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/rllib/evaluation/sampler.py", line 550, in _env_runner
base_env.poll()
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/rllib/env/base_env.py", line 390, in poll
obs[i], rewards[i], dones[i], infos[i] = env_state.poll()
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/rllib/env/base_env.py", line 442, in poll
self.reset()
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/ray/rllib/env/base_env.py", line 460, in reset
self.last_obs = self.env.reset()
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/benchmark/wrappers/rllib/frame_stack.py", line 204, in reset
return self._get_observations(observations)
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/benchmark/wrappers/rllib/frame_stack.py", line 160, in get_observations
observation = self.observation_adapter(observation)
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/benchmark/wrappers/rllib/frame_stack.py", line 119, in func
observation = cal_obs(env_obs_seq, observation_space, feature_configs)
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/benchmark/common.py", line 889, in cal_obs
obs_np.append(cal_obs(obs, sub_space, feature_configs))
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/benchmark/common.py", line 884, in cal_obs
obs_np[name] = getattr(CalObs, f"cal
{name}")(env_obs, *args)
File "/home/behazy/SMARTS/.venv/lib/python3.8/site-packages/benchmark/common.py", line 174, in cal_goal_relative_pos
assert isinstance(goal, PositionalGoal), goal
AssertionError: EndlessGoal()

@Behazy Behazy added the help wanted Extra attention is needed label Apr 18, 2022
@Gamenot Gamenot linked a pull request Apr 18, 2022 that will close this issue
@Gamenot
Copy link
Collaborator

Gamenot commented Apr 18, 2022

Hello @Behazy, I am not sure if this is a regression because I have seen the issue before. The MaRL benchmark does not work with scenarios that use EndlessGoal because the benchmark requires an end location via PositionalGoal to construct the observations and rewards.

In a scenario file, EndlessMission relates to EndlessGoal and Mission relates to PositionalGoal.

If you wish to use scenarios with EndlessMissions it would currently require:

#Agent config
agent:
  state:
    features:
      goal_relative_pos: False

I have opened a PR #1390 to get rid of this issue for good (hopefully.)

@Gamenot Gamenot self-assigned this Apr 18, 2022
@Gamenot
Copy link
Collaborator

Gamenot commented May 3, 2022

Issue appears to be fixed with #1390.

@Gamenot Gamenot closed this as completed May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants