LiangZhang1996 / DataLight-old

code for "Data Might be Enough: Bridge Real-World Traffic Signal Control Using Offline Reinforcement Learning"
GNU General Public License v3.0
10 stars 1 forks source link

lack of file "generate_offline_data" #5

Open luckywlj opened 1 year ago

luckywlj commented 1 year ago

According to your paper and the README, your code repository is lack of the file "generate_offline_data" so as to fail to run the offline rl code. Could you please provide this file? When I run the file "run_offline.py", error occurs as follows:

NotADirectoryError: [Errno 20] Not a directory: './memory/cycle_mix.pkl'

LiangZhang1996 commented 1 year ago

I am updating my article and the source code. There is a large difference, and I will refresh this project in one month.

luckywlj commented 1 year ago

Thank you for your works! Respect!

luckywlj commented 1 year ago

Just now, I found that you provide the link of memory and there are three data files can be downloaded. How to place the data file to the ./memory? Because the memory is a file but not a directory.

LiangZhang1996 commented 1 year ago
  1. make a directory "./memory/"
  2. place the downloaded files at this directory as: "./memeory/cycle_mix.pkl"
luckywlj commented 1 year ago

I have finished the two steps and run "run_offline.py", there is errors as follows: The major error is : ValueError: unsupported pickle protocol: 5

2023-10-16 22-41-10 的屏幕截图

My tenserflow version is 2.11 and python version is 3.7.4.

LiangZhang1996 commented 1 year ago

It is the problem that you cannot load the pickle file. It may be the incorrect version of pickle. Maybe you could use a lower version of pickle or refer to stackoverflow

luckywlj commented 1 year ago

It is the problem that you cannot load the pickle file. It may be the incorrect version of pickle. Maybe you could use a lower version of pickle or refer to stackoverflow

Thanks a lot, I try it again and pip install pickle5. Then this problem is solved. Thank you again!

luckywlj commented 1 year ago

After running "run_offline.py", I respectively run "run_cycle.py" and "run_test.py" and obtain the following errors:

python run_cycle.py

Process Process-2: Traceback (most recent call last): File "/home/luckywlj/anaconda3/envs/cityflow/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/home/luckywlj/anaconda3/envs/cityflow/lib/python3.6/multiprocessing/process.py", line 93, in run self._target(*self._args, **self._kwargs) File "run_cycle.py", line 164, in testor_wrapper old_round) File "run_cycle.py", line 186, in init intersection_id=str(0) File "/home/luckywlj/traffic_signal_control/DataLight-main/models/network_agent.py", line 46, in init if os.listdir(self.dic_path["PATH_TO_MODEL"]): FileNotFoundError: [Errno 2] No such file or directory: 'model/benchmark_0214_2/anon_3_4_jinan_real3.json_02_14_18_54_26' traffic finish join 0 traffic to join 1 traffic finish join 1

python run_test.py .......... Process Process-1: Traceback (most recent call last): File "/home/luckywlj/anaconda3/envs/cityflow/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/home/luckywlj/anaconda3/envs/cityflow/lib/python3.6/multiprocessing/process.py", line 93, in run self._target(*self._args, **self._kwargs) File "run_test.py", line 159, in testor_wrapper old_round) File "run_test.py", line 181, in init intersection_id=str(0) File "/home/luckywlj/traffic_signal_control/DataLight-main/models/network_agent.py", line 46, in init if os.listdir(self.dic_path["PATH_TO_MODEL"]): FileNotFoundError: [Errno 2] No such file or directory: 'model/benchmark_0216_13/anon_3_4_jinan_real3.json_02_16_22_14_17' traffic finish join 0 traffic to join 1 traffic finish join 1

both errors imply the lack of model/benchmark_0216_13/anon_3_4_jinan_real3.json_02_16_22_14_17. I check the model folder and there is only a sub folder "benchmark_1001". I check the utils/config.py and the code is ' "PATH_TO_MODEL": "model/default" '. I think the two code files can not find the data of jinan 3x4, but the data is in their running configurations so as to throw errors. Could you please tell me how to do?
BTW: After running "run_offline.py", a new folder "records" occurs, in which there is three sub folders "benchmark_0214_c_2","benchmark_0216_t_13","benchmark_1001". In the three sub folders, there are only the data of hangzhou4x4.

LiangZhang1996 commented 1 year ago

It would help if you used the correct folder path.