DriveML Huawei Autonomous Vehicles Challenge Forum

Go back to competition Back to thread list Post in this thread

> AssertionError: activation must be in [0..1]

Hi, I didn't do anything in action function, why this error usually occurs when the agent was training?
Traceback (most recent call last):
File "/home/ma/anaconda3/envs/tf/lib/python3.7/site-packages/ray/tune/trial_runner.py", line 515, in _process_trial
result = self.trial_executor.fetch_result(trial)
File "/home/ma/anaconda3/envs/tf/lib/python3.7/site-packages/ray/tune/ray_trial_executor.py", line 351, in fetch_result
result = ray.get(trial_future[0])
File "/home/ma/anaconda3/envs/tf/lib/python3.7/site-packages/ray/worker.py", line 2121, in get
raise value.as_instanceof_cause()
ray.exceptions.RayTaskError(AssertionError): ray_worker (pid=7148, host=sptuan-Super-Server)
File "/home/ma/anaconda3/envs/tf/lib/python3.7/site-packages/ray/rllib/agents/trainer.py", line 418, in train
raise e
File "/home/ma/anaconda3/envs/tf/lib/python3.7/site-packages/ray/rllib/agents/trainer.py", line 407, in train
result = Trainable.train(self)
File "/home/ma/anaconda3/envs/tf/lib/python3.7/site-packages/ray/tune/trainable.py", line 176, in train
result = self._train()
File "/home/ma/anaconda3/envs/tf/lib/python3.7/site-packages/ray/rllib/agents/trainer_template.py", line 129, in _train
fetches = self.optimizer.step()
File "/home/ma/anaconda3/envs/tf/lib/python3.7/site-packages/ray/rllib/optimizers/multi_gpu_optimizer.py", line 140, in step
self.num_envs_per_worker, self.train_batch_size)
File "/home/ma/anaconda3/envs/tf/lib/python3.7/site-packages/ray/rllib/optimizers/rollout.py", line 29, in collect_samples
next_sample = ray_get_and_free(fut_sample)
File "/home/ma/anaconda3/envs/tf/lib/python3.7/site-packages/ray/rllib/utils/memory.py", line 33, in ray_get_and_free
result = ray.get(object_ids)
ray.exceptions.RayTaskError(AssertionError): ray_worker (pid=7142, host=sptuan-Super-Server)
File "/home/ma/anaconda3/envs/tf/lib/python3.7/site-packages/ray/rllib/evaluation/rollout_worker.py", line 469, in sample
batches = [self.input_reader.next()]
File "/home/ma/anaconda3/envs/tf/lib/python3.7/site-packages/ray/rllib/evaluation/sampler.py", line 56, in next
batches = [self.get_data()]
File "/home/ma/anaconda3/envs/tf/lib/python3.7/site-packages/ray/rllib/evaluation/sampler.py", line 99, in get_data
item = next(self.rollout_provider)
File "/home/ma/anaconda3/envs/tf/lib/python3.7/site-packages/ray/rllib/evaluation/sampler.py", line 340, in _env_runner
base_env.send_actions(actions_to_send)
File "/home/ma/anaconda3/envs/tf/lib/python3.7/site-packages/ray/rllib/env/base_env.py", line 332, in send_actions
self.vector_env.vector_step(action_vector)
File "/home/ma/anaconda3/envs/tf/lib/python3.7/site-packages/ray/rllib/env/vector_env.py", line 110, in vector_step
obs, r, done, info = self.envs[i].step(actions[i])
File "/home/ma/anaconda3/envs/tf/lib/python3.7/site-packages/gym_hiway/env/competition_env.py", line 135, in step
observation, reward, agent_dones = self._engine.step(action_msg)
File "/home/ma/anaconda3/envs/tf/lib/python3.7/site-packages/hiway/game_engine.py", line 53, in step
return self._step(action_msg)
File "/home/ma/anaconda3/envs/tf/lib/python3.7/site-packages/hiway/game_engine.py", line 110, in _step
self._sims[sim_id].perform_agent_actions(agent_actions)
File "/home/ma/anaconda3/envs/tf/lib/python3.7/site-packages/hiway/bullet_simulation.py", line 288, in perform_agent_actions
agent.perform_action(self, agent_id, vehicle, action)
File "/home/ma/anaconda3/envs/tf/lib/python3.7/site-packages/gym_hiway/env/simple_agent.py", line 109, in perform_action
vehicle.apply_throttle(throttle)
File "/home/ma/anaconda3/envs/tf/lib/python3.7/site-packages/hiway/vehicle.py", line 373, in apply_throttle
assert 0 <= activation and activation <= 1, 'activation must be in [0..1]'
AssertionError: activation must be in [0..1]

Posted by: team_19 @ Nov. 14, 2019, 5:01 p.m.

Hi, apologies for the delay in response. These assertion errors may appear if you pass in NaN's for any of the agent action values

Posted by: HuaweiUK @ Nov. 25, 2019, 1:31 a.m.
Post in this thread