guang0123 / PRGLight

10 stars 1 forks source link

fail to load network #6

Open luckywlj opened 8 months ago

luckywlj commented 8 months ago

Hi. First of all, thank you for your code repository. When I run the code, some errors occur as follows:

*generator_3 Load data for system in generator_3 Error occurs when making samples for inter 0 traceback.format_exc(): Traceback (most recent call last): File "/home/xxx/PRGLight/construct_sample.py", line 25, in load_data logging_data = pickle.load(f_logging_data) EOFError: Ran out of input \============== update network ============= update to join # self.eng.reset() to be implemented \========================= {'interval': 1, 'seed': 0, 'laneChange': False, 'dir': 'records/12_26_11_31_30/', 'roadnetFile': 'roadnet_4_4.json', 'flowFile': 'anon_4_4_hangzhou_real.json', 'rlTrafficLight': True, 'saveReplay': False, 'roadnetLogFile': 'frontend/web/roadnetLogFile.json', 'replayLogFile': 'frontend/web/replayLogFile.txt'} Process Process-1:149: Traceback (most recent call last): File "/home/xxx/anaconda3/envs/python375/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap self.run() File "/home/xxx/anaconda3/envs/python375/lib/python3.7/multiprocessing/process.py", line 99, in run self._target(self._args, self._kwargs) File "/home/xxx/PRGLight/pipeline.py", line 205, in updater_wrapper bar_round=bar_round File "/home/xxx/PRGLight/updater.py", line 34, in init env_tmp.reset() File "/home/xxx/PRGLight/anon_env.py", line 887, in reset inter.build_adjacency_row_lane(self.lane_id_to_index) File "/home/xxx/PRGLight/anon_env.py", line 294, in build_adjacency_row_lane top_k_entering_lane.append(lane_id_to_global_index_dict[lane_id] if lane_id is not None else -1) KeyError: 'road_2_0_1_0' update finish join ---------------------------- Error occurs when READING pickles when down sampling for inter 0, <_io.BufferedReader name='records/12_26_11_31_30/train_round/round_24/generator_0/inter_0.pkl'> traceback.format_exc(): Traceback (most recent call last): File "/home/xxx/PRGLight/pipeline.py", line 226, in downsample logging_data = pickle.load(f_logging_data) EOFError: Ran out of input .......

---------------------------- \============== test evaluation ============= \============== early stopping ============= \============== model pool evaluation ============= best_round: None Generator time: 0.0625462532043457 Making samples time: 0.0003247261047363281 update_network time: 0.05780982971191406 test_evaluation time: 0.0011382102966308594 round 29 ends, total_time: 0.12189340591430664 # self.eng.reset() to be implemented \========================= {'interval': 1, 'seed': 0, 'laneChange': False, 'dir': 'records/12_26_11_34_46/', 'roadnetFile': 'roadnet_4_4.json', 'flowFile': 'anon_4_4_hangzhou_real.json', 'rlTrafficLight': True, 'saveReplay': False, 'roadnetLogFile': 'frontend/web/roadnetLogFile.json', 'replayLogFile': 'frontend/web/replayLogFile.txt'} traceback.format_exc(): Traceback (most recent call last): File "/home/xxx/PRGLight/model_test.py", line 97, in test state = env.reset() File "/home/xxx/PRGLight/anon_env.py", line 887, in reset inter.build_adjacency_row_lane(self.lane_id_to_index) File "/home/xxx/PRGLight/anon_env.py", line 294, in build_adjacency_row_lane top_k_entering_lane.append(lane_id_to_global_index_dict[lane_id] if lane_id is not None else -1) KeyError: 'road_2_0_1_0'

The information of error_info.txt is as follows:

round_0 fail to test model round_1 fail to test model round_2 fail to test model ....... round_27 fail to test model round_28 fail to test model round_29 fail to test model

According to the error information, the model file can not be loaded in the model_test.py, I check the model/mm_dd_hh_mm_ss/ dictionary and it is empty. I also check the records/mm_dd_hh_mm_ss/test_round or train_round dictionary and *.pkl file is 0 bytes. So I think that the train model is not saved. Could you please reply how to solve the problem? thank a lot for your help!

programmer-888 commented 2 months ago

你好。首先,谢谢你的代码仓库。 当我运行代码时,出现了以下错误:

*generator_3 在 generator_3 中为系统加载数据为 inter 0 traceback.format_exc() 制作样本时出错: 回溯(最近一次调用最后一次): 文件“/home/xxx/PRGLight/construct_sample.py”,第 25 行,在 load_data 中 logging_data = pickle.load(f_logging_data) EOFError:输入不足 ============== 更新网络 ============== 更新以加入 # self.eng.reset() 待实现 ========================== {'interval': 1, 'seed': 0, 'laneChange': False, 'dir': 'records/12_26_11_31_30/', 'roadnetFile': 'roadnet_4_4.json', 'flowFile': 'anon_4_4_hangzhou_real.json'、'rlTrafficLight': True、'saveReplay': False、'roadnetLogFile': 'frontend/web/roadnetLogFile.json'、'replayLogFile': 'frontend/web/replayLogFile.txt'} 进程 Process-1:149: 回溯(最近一次调用最后一次): 文件“/home/xxx/anaconda3/envs/python375/lib/python3.7/multiprocessing/process.py”,第 297 行,在 _bootstrap self.run() 文件“/home/xxx/anaconda3/envs/python375/lib/python3.7/multiprocessing/process.py”,第 99 行,在运行中 self._target(self._args, self._kwargs)**文件“/home/xxx/PRGLight/pipeline.py”,第 205 行,在 updater_wrapper 中 bar_round=bar_round 文件“/home/xxx/PRGLight/updater.py”,第 34 行,在 init env_tmp.reset() 文件“/home/xxx/PRGLight/anon_env.py”,第 887 行,在 reset inter.build_adjacency_row_lane(self.lane_id_to_index) 文件“/home/xxx/PRGLight/anon_env.py”,第 294 行,在 build_adjacency_row_lane top_k_entering_lane.append(lane_id_to_global_index_dict[lane_id] if lane_id is not None else -1) KeyError: 'road_2_0_1_0' update finish join ---------------------------- 当对 inter 0 进行下采样时,READING 腌制时发生错误,<_io.BufferedReader name='records/12_26_11_31_30/train_round/round_24/generator_0/inter_0.pkl'> traceback.format_exc(): Traceback(最近一次调用最后一次): 文件“/home/xxx/PRGLight/pipeline.py”,第 226 行,在 downsample 中 logging_data = pickle.load(f_logging_data) EOFError:输入不足 ……** ****

---------------------------- ============== 测试评估 ============== ============== 提前停止 ============== =============== 模型池评估 ============== best_round:无 生成器时间:0.0625462532043457 制作样本时间:0.0003247261047363281 更新网络时间:0.05780982971191406 测试评估时间:0.0011382102966308594 第 29 轮结束,总时间:0.12189340591430664 # 待实现的 self.eng.reset() ============================ {'interval': 1, 'seed': 0, 'laneChange': False, 'dir': 'records/12_26_11_34_46/', 'roadnetFile': 'roadnet_4_4.json', 'flowFile': 'anon_4_4_hangzhou_real.json', 'rlTrafficLight': True, 'saveReplay': False, 'roadnetLogFile': 'frontend/web/roadnetLogFile.json', 'replayLogFile': 'frontend/web/replayLogFile.txt'} traceback.format_exc(): Traceback(最近一次调用最后一次): 文件“/home/xxx/PRGLight/model_test.py”,第 97 行,处于测试 状态 = env.reset() 文件“/home/xxx/PRGLight/anon_env.py”, 第 887 行, 在 reset inter.build_adjacency_row_lane(self.lane_id_to_index) 文件“/home/xxx/PRGLight/anon_env.py”, 第 294 行, 在 build_adjacency_row_lane top_k_entering_lane.append(lane_id_to_global_index_dict[lane_id] if lane_id is not None else -1) KeyError: 'road_2_0_1_0'

error_info.txt信息如下:

round_0 无法测试模型 round_1 无法测试模型 round_2 无法测试模型 ....... round_27 无法测试模型 round_28 无法测试模型 round_29 无法测试模型

根据错误信息,模型文件无法加载到model_test.py中,我检查了model/mm_dd_hh_mm_ss/字典,发现它是空的。我还检查了records/mm_dd_hh_mm_ss/test_round或train_round字典,发现*.pkl文件为0字节。所以我认为训练模型没有保存。你能回复如何解决这个问题吗?非常感谢你的帮助!

May I ask if you have solved this problem? If so, could you please teach me how to solve it? I have also encountered the same problem. Thank you.