You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Steps to reproduce the bug
Run the following code:
import os
import gym
from smarts.core.agent_interface import AgentInterface, AgentType
from smarts.core.agent import AgentSpec, Agent
import numpy as np
class SimpleAgent(Agent):
def __init__(self):
self.action_space = gym.spaces.Box(
low=np.array([0, 0, -1.0]), high=np.array([1.0, 1.0, 1.0]), dtype=np.float32
)
def act(self, obs):
# return "keep_lane"
return self.action_space.sample()
agent_spec = AgentSpec(
interface=AgentInterface.from_type(AgentType.Full, max_episode_steps=None),
agent_builder=SimpleAgent,
)
agent_specs = {
"Agent-001": agent_spec,
# "Agent-008": agent_spec,
}
env = gym.make(
"smarts.env:hiway-v0",
scenarios=["scenarios/loop"],
agent_specs=agent_specs,
)
agents = {
agent_id: agent_spec.build_agent()
for agent_id, agent_spec in agent_specs.items()
}
observations = env.reset()
for i in range(100000000):
print(i)
agent_actions = {
agent_id: agents[agent_id].act(agent_obs)
for agent_id, agent_obs in observations.items()
}
for agent_id, agent_obs in observations.items():
a = agents[agent_id].act(agent_obs)
observations, r, d, i = env.step(agent_actions)
observations = env.reset()
Resulting and expected behaviour
Expect to get 100000000 resets but SUMO crashes before then.
Error logs and screenshots
pybullet build time: Dec 23 2020 01:47:29
32427
pybullet build time: Dec 23 2020 01:47:29
32428
pybullet build time: Dec 23 2020 01:47:29
32429
Traceback (most recent call last):
File "examples/simple_example_test.py", line 55, in <module>
observations = env.reset()
File "/home/dev/Desktop/repos/NewSMARTS/SMARTS/smarts/env/hiway_env.py", line 188, in reset
env_observations = self._smarts.reset(scenario)
File "/home/dev/Desktop/repos/NewSMARTS/SMARTS/smarts/core/smarts.py", line 314, in reset
self.setup(scenario)
File "/home/dev/Desktop/repos/NewSMARTS/SMARTS/smarts/core/smarts.py", line 361, in setup
provider_state = self._setup_providers(self._scenario)
File "/home/dev/Desktop/repos/NewSMARTS/SMARTS/smarts/core/smarts.py", line 656, in _setup_providers
provider_state.merge(provider.setup(scenario))
File "/home/dev/Desktop/repos/NewSMARTS/SMARTS/smarts/core/sumo_traffic_simulation.py", line 247, in setup
self._traci_conn.simulation.subscribe(
File "/usr/share/sumo/tools/traci/_simulation.py", line 468, in subscribe
Domain.subscribe(self, "", varIDs, begin, end)
File "/usr/share/sumo/tools/traci/domain.py", line 209, in subscribe
self._connection._subscribe(self._subscribeID, begin, end, objectID, varIDs, parameters)
File "/usr/share/sumo/tools/traci/connection.py", line 242, in _subscribe
result = self._sendCmd(cmdID, (begin, end), objID, format, *args)
File "/usr/share/sumo/tools/traci/connection.py", line 180, in _sendCmd
return self._sendExact()
File "/usr/share/sumo/tools/traci/connection.py", line 90, in _sendExact
raise FatalTraCIError("connection closed by SUMO")
traci.exceptions.FatalTraCIError: connection closed by SUMO
My device also ended with a surprising error:
System information
Operating system & Environment [Please note if using Docker]:
BUG REPORT
I have confirmed, SUMO can freeze when reloading too many times.
SMARTS Version
0.4.12
Previous associated issues
#465 (comment)
Steps to reproduce the bug
Run the following code:
Resulting and expected behaviour
Expect to get 100000000 resets but SUMO crashes before then.
Error logs and screenshots
My device also ended with a surprising error:
System information
pip freeze
]Impact [If known]
Reloading a single scenario repeatedly may crash SUMO.
The text was updated successfully, but these errors were encountered: