question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exceptions in Traffic Light Grid RL Examples

See original GitHub issue

Bug Description

I am running into an issue with the traffic_light_grid examples from both the stable_baselines and rllib set of examples.

For the stable baselines example, the script runs for a few seconds, and then I get an exception that ultimately leads to traci.exceptions.TraCIException: Vehicle 'idm_0' is not known.

For the rllib example, the script continuously runs, but periodically I get the same exception. For the rllib example, I am not using the master branch, rather the one that fixes an issue with the observation space (PR #780).

Bug Reproduce

File in which the bug occurred: flow/examples/stable_baselines/traffic_light_grid.py and flow/examples/rllib/traffic_light_grid.py

The exact command that you did run that caused the bug: python traffic_light_grid.py from either the flow/examples/stable_baselines or flow/examples/rllib folder.

Output Log

Full error output log:

/home/alexandra/Documents/Code/Flow/flow/flow/utils/flow_warnings.py:26: PendingDeprecationWarning: The attribute minGap in SumoCarFollowingParams is deprecated, use min_gap instead.
  PendingDeprecationWarning
Warning: Vehicle 'idm_10' performs emergency braking with decel=-9.00 wished=7.50 severity=1.00, time=16.00.
Warning: Vehicle 'idm_8' performs emergency braking with decel=-9.00 wished=7.50 severity=1.00, time=18.00.
Warning: Vehicle 'idm_8' performs emergency braking with decel=-9.00 wished=7.50 severity=1.00, time=53.00.
Error: Answered with error to command 0xc4: Invalid departLane definition for vehicle 'idm_0';
 must be one of ("random", "free", "allowed", "best", "first", or an int>=0)
Error: Answered with error to command 0xc4: Vehicle 'idm_0' is not known
Traceback (most recent call last):
  File "/home/alexandra/Documents/Code/Flow/flow/flow/envs/base.py", line 486, in reset
    speed=speed)
  File "/home/alexandra/Documents/Code/Flow/flow/flow/core/kernel/vehicle/traci.py", line 1040, in add
    departSpeed=str(speed))
  File "/home/alexandra/miniconda3/envs/flow/lib/python3.6/site-packages/traci/_vehicle.py", line 1427, in add
    self._connection._sendExact()
  File "/home/alexandra/miniconda3/envs/flow/lib/python3.6/site-packages/traci/connection.py", line 106, in _sendExact
    raise TraCIException(err, prefix[1], _RESULTS[prefix[2]])
traci.exceptions.TraCIException: Invalid departLane definition for vehicle 'idm_0';
 must be one of ("random", "free", "allowed", "best", "first", or an int>=0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "examples/stable_baselines/traffic_light_grid.py", line 274, in <module>
    model = run_model(args.num_cpus, args.rollout_size, args.num_steps, args.use_inflows)
  File "examples/stable_baselines/traffic_light_grid.py", line 262, in run_model
    model.learn(total_timesteps=num_steps)
  File "/home/alexandra/miniconda3/envs/flow/lib/python3.6/site-packages/stable_baselines/ppo2/ppo2.py", line 334, in learn
    obs, returns, masks, actions, values, neglogpacs, states, ep_infos, true_reward = runner.run()
  File "/home/alexandra/miniconda3/envs/flow/lib/python3.6/site-packages/stable_baselines/ppo2/ppo2.py", line 475, in run
    self.obs[:], rewards, self.dones, infos = self.env.step(clipped_actions)
  File "/home/alexandra/miniconda3/envs/flow/lib/python3.6/site-packages/stable_baselines/common/vec_env/base_vec_env.py", line 134, in step
    return self.step_wait()
  File "/home/alexandra/miniconda3/envs/flow/lib/python3.6/site-packages/stable_baselines/common/vec_env/dummy_vec_env.py", line 44, in step_wait
    obs = self.envs[env_idx].reset()
  File "/home/alexandra/Documents/Code/Flow/flow/flow/envs/base.py", line 492, in reset
    self.k.kernel_api.vehicle.remove(veh_id)  # FIXME: hack
  File "/home/alexandra/miniconda3/envs/flow/lib/python3.6/site-packages/traci/_vehicle.py", line 1435, in remove
    tc.CMD_SET_VEHICLE_VARIABLE, tc.REMOVE, vehID, reason)
  File "/home/alexandra/miniconda3/envs/flow/lib/python3.6/site-packages/traci/connection.py", line 143, in _sendByteCmd
    self._sendExact()
  File "/home/alexandra/miniconda3/envs/flow/lib/python3.6/site-packages/traci/connection.py", line 106, in _sendExact
    raise TraCIException(err, prefix[1], _RESULTS[prefix[2]])
traci.exceptions.TraCIException: Vehicle 'idm_0' is not known

Versions

  • OS: Ubuntu 18.04
  • Flow version: 0.5.0.dev
  • Flow commit number: 44e21a3a711c8f08fc49bf5945fb074e9f41c61d

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
eugenevinitskycommented, Dec 6, 2019

Too many kevins.

0reactions
dimikout3commented, Sep 22, 2020

Hello, did anyone solve this issue ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reinforcement Learning Benchmarks for Traffic Signal Control
We propose a toolkit for developing and comparing reinforcement learning (RL)- based traffic signal controllers. The toolkit includes implementation of ...
Read more >
Traffic State Agnostic Agent vs. Holistic Agent With Current V2I
ABSTRACT Traffic light control falls into two main categories: Agnostic systems ... proven ability of RL to solve complex control problems.
Read more >
Comparing Exploration Approaches in ... - Frans A. Oliehoek
Abstract. Identifying the most efficient exploration approach for deep reinforcement learning in traffic light control is not a trivial task, and can be...
Read more >
Reinforcement Learning for Traffic Signal Control
In this tutorial, we first introduce the formulation of traffic light control problems under RL, and then classify and discuss the current RL...
Read more >
FLOW error when running "python examples/rllib ...
I am trying to run a multiagent experiment on the RL-Framework Flow for SUMO. However, if I try ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found