suessmann / intelligent_traffic_lights

Traffic Lights Control with Deep Learning
MIT License
68 stars 14 forks source link

FileNotFoundError: [Errno 2] No such file or directory: './cfg/episode_routes.rou.xml' #9

Open TrinhTuanHung2021 opened 2 years ago

TrinhTuanHung2021 commented 2 years ago

Thank you for sharing your coding. When I ran python train.py -c config.yaml, it gave error FileNotFoundError: [Errno 2] No such file or directory: './cfg/episode_routes.rou.xml'

I checked that folder and I did not see episode_routes.rou.xml file.

image

Could you show me how to create this file or you can upload it to github for user convenience. Thank you

TrinhTuanHung2021 commented 2 years ago

I tried to create the episode_routes.rou.xml file with the coding in generator.py as below

    <vType accel="1.0" decel="4.5" id="standard_car" length="5.0" minGap="2.5" maxSpeed="25" sigma="0.5" />
    <route id="W_N" edges="W2TL TL2N"/>
    <route id="W_E" edges="W2TL TL2E"/>
    <route id="W_S" edges="W2TL TL2S"/>
    <route id="N_W" edges="N2TL TL2W"/>
    <route id="N_E" edges="N2TL TL2E"/>
    <route id="N_S" edges="N2TL TL2S"/>
    <route id="E_W" edges="E2TL TL2W"/>
    <route id="E_N" edges="E2TL TL2N"/>
    <route id="E_S" edges="E2TL TL2S"/>
    <route id="S_W" edges="S2TL TL2W"/>
    <route id="S_N" edges="S2TL TL2N"/>
    <route id="S_E" edges="S2TL TL2E"/>

After running train.py -c config.yaml, it had another error

(Hung3.7) osboxes@osboxes:~/Desktop/intelligent_traffic_lights-master$ python train.py -c config.yaml {'learning_rate': 1e-05, 'gamma': 0.95, 'buffer_limit': 5000, 'batch_size': 128, 'sim_len': 4500, 'mem_refill': 1000, 'epochs': 1600, 'n_cars': 1000, 'weights_path': '', 'sumoBinary': '', 'sumoCmd': '', 'sumoTools': ''} /home/osboxes/Desktop/intelligent_traffic_lights-master/src/training.py:16: UserWarning: nn.init.xavier_uniform is now deprecated in favor of nn.init.xavieruniform. torch.nn.init.xavier_uniform(m.weight.data) /home/osboxes/Desktop/intelligent_trafficlights-master/src/training.py:17: UserWarning: nn.init.constant is now deprecated in favor of nn.init.constant. nn.init.constant(m.bias.data, 0) No model weights found, initializing xavier_uniform Traceback (most recent call last): File "train.py", line 15, in training(cfg) File "/home/osboxes/Desktop/intelligent_traffic_lights-master/src/training.py", line 69, in training env = SumoIntersection(sumoBinary, sumoCmd, sim_len, n_cars) File "/home/osboxes/Desktop/intelligent_traffic_lights-master/src/env.py", line 29, in init traci.start(self.sumoCmd) File "/home/osboxes/anaconda3/envs/Hung3.7/lib/python3.7/site-packages/traci/main.py", line 168, in start sumoProcess = subprocess.Popen(cmd2, stdout=stdout) File "/home/osboxes/anaconda3/envs/Hung3.7/lib/python3.7/subprocess.py", line 800, in init restore_signals, start_new_session) File "/home/osboxes/anaconda3/envs/Hung3.7/lib/python3.7/subprocess.py", line 1551, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) PermissionError: [Errno 13] Permission denied: ''