huawei-noah / SMARTS

Scalable Multi-Agent RL Training School for Autonomous Driving
MIT License
954 stars 190 forks source link

[Help Request]sumo.tools.traci.exceptions.FatalTraCIError: Connection closed by SUMO. #2110

Closed DOPEMANdd closed 1 year ago

DOPEMANdd commented 1 year ago

High Level Description

When I am training in the comp-1 branch, the program always breaks, how to solve this problem?

Version

comp-1

Operating System

ubuntu22.04

Problems

Traceback (most recent call last): File "train_ppo.py", line 83, in state, dones = env.reset(), {"all": False} File "/data/zhangdi/anaconda3/envs/smart/lib/python3.8/site-packages/gym/core.py", line 251, in reset return self.env.reset(kwargs) File "/data/zhangdi/SMARTS/smarts/env/multi_scenario_env.py", line 341, in reset obs = self.env.reset(kwargs) File "/data/zhangdi/SMARTS/smarts/env/hiway_env.py", line 269, in reset env_observations = self._smarts.reset(scenario) File "/data/zhangdi/SMARTS/smarts/core/smarts.py", line 410, in reset raise first_exception File "/data/zhangdi/SMARTS/smarts/core/smarts.py", line 403, in reset return self._reset(scenario, start_time) File "/data/zhangdi/SMARTS/smarts/core/smarts.py", line 440, in _reset self.setup(scenario) File "/data/zhangdi/SMARTS/smarts/core/smarts.py", line 470, in setup provider_state = self._setup_providers(self._scenario) File "/data/zhangdi/SMARTS/smarts/core/smarts.py", line 1112, in _setup_providers new_provider_state = self._handle_provider(provider, provider_error) File "/data/zhangdi/SMARTS/smarts/core/smarts.py", line 1171, in _handle_provider raise provider_error File "/data/zhangdi/SMARTS/smarts/core/smarts.py", line 1110, in _setup_providers new_provider_state = provider.setup(scenario) File "/data/zhangdi/SMARTS/smarts/core/sumo_traffic_simulation.py", line 334, in setup self._traci_conn.simulation.subscribe( File "/data/zhangdi/anaconda3/envs/smart/lib/python3.8/site-packages/sumo/tools/traci/_simulation.py", line 671, in subscribe Domain.subscribe(self, "", varIDs, begin, end) File "/data/zhangdi/anaconda3/envs/smart/lib/python3.8/site-packages/sumo/tools/traci/domain.py", line 188, in subscribe self._connection._subscribe(self._subscribeID, begin, end, objectID, varIDs, parameters) File "/data/zhangdi/anaconda3/envs/smart/lib/python3.8/site-packages/sumo/tools/traci/connection.py", line 295, in _subscribe result = self._sendCmd(cmdID, (begin, end), objID, format, *args) File "/data/zhangdi/anaconda3/envs/smart/lib/python3.8/site-packages/sumo/tools/traci/connection.py", line 231, in _sendCmd return self._sendExact() File "/data/zhangdi/anaconda3/envs/smart/lib/python3.8/site-packages/sumo/tools/traci/connection.py", line 137, in _sendExact raise FatalTraCIError("Connection closed by SUMO.") sumo.tools.traci.exceptions.FatalTraCIError: Connection closed by SUMO. Exception ignored in: <function SMARTS.del at 0x7fc409614940> Traceback (most recent call last): File "/data/zhangdi/SMARTS/smarts/core/smarts.py", line 856, in del TypeError: 'NoneType' object is not callable Exception ignored in: <function _ShowBaseInstance.del at 0x7fc406e73940> Traceback (most recent call last): File "/data/zhangdi/SMARTS/smarts/core/renderer.py", line 140, in del File "/data/zhangdi/SMARTS/smarts/core/renderer.py", line 136, in destroy File "/data/zhangdi/anaconda3/envs/smart/lib/python3.8/site-packages/direct/showbase/ShowBase.py", line 601, in destroy TypeError: 'NoneType' object is not callable Exception ignored in: <function BulletClient.del at 0x7fc433673c10> Traceback (most recent call last): File "/data/zhangdi/anaconda3/envs/smart/lib/python3.8/site-packages/pybullet_utils/bullet_client.py", line 43, in del TypeError: catching classes that do not inherit from BaseException is not allowed

Adaickalavan commented 1 year ago

Hi @DOPEMANdd,

  1. The comp-1 branch was used for 2022 NeurIPS Driving Smarts competition and has since been archived, with no further updates expected.

  2. Going forward, please use the latest code version from the master branch. The latest code version sidesteps the sumo.tools.traci.exceptions.FatalTraCIError: Connection closed by SUMO error.

  3. If you are interested in training and benchmarking your agents, please consider using the latest Driving Smarts 2023.1 & 2023.2 and Driving Smarts 2023.3 benchmarks.