AndreaVidali / Deep-QLearning-Agent-for-Traffic-Signal-Control

A framework where a deep Q-Learning Reinforcement Learning agent tries to choose the correct traffic light phase at an intersection to maximize traffic efficiency.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

connection closed by SUMO

navid-kalaei opened this issue · comments

I was interested in your awesome work and tried to run the training_main.py. However, sadly it failed. I was wondering if you could reply to this issue at your convenience. Here are the details in the hope they guide us more

----- Episode 1 of 100
 Retrying in 1 seconds
Loading configuration... done.
Simulating...
Error: tcpip::Storage::readIsSafe: want to read 4 bytes from Storage, but only 3 remaining
Quitting (on error).
Traceback (most recent call last):
  File "training_main.py", line 66, in <module>
    simulation_time, training_time = Simulation.run(episode, epsilon)  # run the simulation
  File "/content/Deep-QLearning-Agent-for-Traffic-Signal-Control/TLCS/training_simulation.py", line 82, in run
    self._simulate(self._green_duration)
  File "/content/Deep-QLearning-Agent-for-Traffic-Signal-Control/TLCS/training_simulation.py", line 115, in _simulate
    traci.simulationStep()  # simulate 1 step in sumo
  File "/usr/local/lib/python3.6/dist-packages/traci/main.py", line 173, in simulationStep
    return _connections[""].simulationStep(step)
  File "/usr/local/lib/python3.6/dist-packages/traci/connection.py", line 323, in simulationStep
    result = self._sendExact()
  File "/usr/local/lib/python3.6/dist-packages/traci/connection.py", line 101, in _sendExact
    raise FatalTraCIError("connection closed by SUMO")
traci.exceptions.FatalTraCIError: connection closed by SUMO

Environment:

Platform: Google Colab
Python: 3.6.9
Sumo: Latest from commit 7c2d62c3

Error: tcpip::Storage::readIsSafe: want to read 4 bytes from Storage, but only 3 remaining

I am not sure if you have figured it out, but it seems to be the tcpip setup issue. By the way, I am also a SUMO new user.

@Flexing920 Thank you so much for your reply 👍
The issue was the mismatch version of SUMO and the Python interface. Just as a heads up the SUMO available on the Linux repositories is too old to be usable, so the manual compiling from the actual source resolve the mentioned issue.

@Flexing920 Thank you so much for your reply 👍
The issue was the mismatch version of SUMO and the Python interface. Just as a heads up the SUMO available on the Linux repositories is too old to be usable, so the manual compiling from the actual source resolve the mentioned issue.

Thanks for your update.