eleurent / social-attention

Social Attention for Autonomous Decision-Making in Dense Traffic
https://eleurent.github.io/social-attention/
21 stars 0 forks source link

Missing analyze.py file #4

Open ashok-arora opened 7 months ago

ashok-arora commented 7 months ago

Hey, In the last step of the readme, there's a mention of analyze.py file which is missing in the rl-agents repo. Could you please share a link to it so I can compare the results of the three algorithms across the metrics: reward, length and velocity?

eleurent commented 7 months ago

Yes I removed it because it was quite specific and not too useful (just loads the data and plots it). You can still find it in the repo history, here is the last commit before it was removed:

https://github.com/eleurent/rl-agents/blob/26e940452648dd0ce1312b1fffb6b801c37d1b26/scripts/analyze.py

ashok-arora commented 4 months ago

@eleurent I hope you are doing well.

I ran the analyze.py file and it gave the following error:

hp@admin ~/D/a/r/scripts ((26e94045…)) [1]> python analyze.py run out/IntersectionEnv/DQNAgent/                                                                                                        (rl-agents) 
INFO:root:Fetching data in out/IntersectionEnv/DQNAgent
ERROR:rl_agents.trainer.monitor:No manifests found in training directory out/IntersectionEnv/DQNAgent/baseline_20240705-160705_1029185
ERROR:rl_agents.trainer.monitor:No manifests found in training directory out/IntersectionEnv/DQNAgent/saved_models
INFO:root:Found 2 runs.
df.columns = []
Traceback (most recent call last):
  File "analyze.py", line 135, in <module>
    main()
  File "analyze.py", line 36, in main
    RunAnalyzer(opts['<run_folder>'], out=opts["--out"], episodes_range=episodes_range)
  File "analyze.py", line 49, in __init__
    self.analyze()
  File "analyze.py", line 100, in analyze
    self.find_best_run()
  File "analyze.py", line 115, in find_best_run
    df = df[df["episode"] == df["episode"].max()].sort_values(criteria, ascending=ascending)
  File "/home/hp/.local/lib/python3.8/site-packages/pandas/core/frame.py", line 3761, in __getitem__
    indexer = self.columns.get_loc(key)
  File "/home/hp/.local/lib/python3.8/site-packages/pandas/core/indexes/range.py", line 349, in get_loc
    raise KeyError(key)
KeyError: 'episode'