Exceptions in Traffic Light Grid RL Examples
See original GitHub issueBug 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:
- Created 4 years ago
- Comments:11 (8 by maintainers)
Top GitHub Comments
Too many kevins.
Hello, did anyone solve this issue ?