question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hello, I was able to run an experiment with the HighwayEnv successfully and now I am trying to analyze the data. Unfortunately I cannot seem to figure it out. I am running the command

!python3 scripts/analyze.py run path/to/data/openaigym.episode_batch.0.953.stats.json

but I keep getting the following error


INFO:root:Fetching data in out/HighwayEnv/DQNAgent/run_20200413-214123_953/run/openaigym.episode_batch.0.953.stats INFO:root:Found 0 runs. Traceback (most recent call last): File “/usr/local/lib/python3.6/dist-packages/pandas/core/indexes/base.py”, line 2646, in get_loc return self._engine.get_loc(key) File “pandas/_libs/index.pyx”, line 111, in pandas._libs.index.IndexEngine.get_loc File “pandas/_libs/index.pyx”, line 138, in pandas._libs.index.IndexEngine.get_loc File “pandas/_libs/hashtable_class_helper.pxi”, line 1619, in pandas._libs.hashtable.PyObjectHashTable.get_item File “pandas/_libs/hashtable_class_helper.pxi”, line 1627, in pandas._libs.hashtable.PyObjectHashTable.get_item KeyError: ‘episode’

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “rl-agents/scripts/analyze.py”, line 131, in <module> main() File “rl-agents/scripts/analyze.py”, line 36, in main RunAnalyzer(opts[‘<run_folder>’], out=opts[“–out”], episodes_range=episodes_range) File “rl-agents/scripts/analyze.py”, line 49, in init self.analyze() File “rl-agents/scripts/analyze.py”, line 97, in analyze self.find_best_run() File “rl-agents/scripts/analyze.py”, line 111, in find_best_run df = df[df[“episode”] == df[“episode”].max()].sort_values(criteria, ascending=ascending) File “/usr/local/lib/python3.6/dist-packages/pandas/core/frame.py”, line 2800, in getitem indexer = self.columns.get_loc(key) File “/usr/local/lib/python3.6/dist-packages/pandas/core/indexes/base.py”, line 2648, in get_loc return self._engine.get_loc(self._maybe_cast_indexer(key)) File “pandas/_libs/index.pyx”, line 111, in pandas._libs.index.IndexEngine.get_loc File “pandas/_libs/index.pyx”, line 138, in pandas._libs.index.IndexEngine.get_loc File “pandas/_libs/hashtable_class_helper.pxi”, line 1619, in pandas._libs.hashtable.PyObjectHashTable.get_item File “pandas/_libs/hashtable_class_helper.pxi”, line 1627, in pandas._libs.hashtable.PyObjectHashTable.get_item KeyError: ‘episode’


I assume the issue with pandas stems from the fact that it says “Found 0 runs” and therefore could not pass that data on. I’m not too familiar with json files and I’ve tried running

!python3 scripts/analyze.py run path/to/data/

among many others things to get it to work but have not been successful. Could you help me figure out how to analyze the data? Are there specific files that need to be in the same folder as the stats.json?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mkapron9commented, Apr 16, 2020

Oh that makes sense. I was able to run the benchmarks and got some good plots. Thank you for your help. One quick question, what is the meaning of the “crashed” metric? It seems to jump around a bit between 0 and 1 with increments of 0.1. I couldn’t find how that was being calculated.

0reactions
eleurentcommented, Apr 17, 2020

Yes exactly, otherwise you get noisy plots difficult to read. Here, you can read it as a probability of having a collision in 10 episodes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Analyze Data: A Basic Guide | Geckoboard blog
Learn how to analyze data with this guide to help you master some basic analysis skills: cleaning data, analyzing trends, ...
Read more >
What Is Data Analysis? (With Examples) - Coursera
Data analysis is the practice of working with data to glean useful information, which can then be used to make informed decisions.
Read more >
How to Analyze Data: Steps Toward Better Business ...
Step 1: Define your goals · Step 2: Decide how to measure goals · Step 3: Collect your data · Step 4: Analyze...
Read more >
What is Data Analysis: Methods, Process and Types Explained
Data Analytics is the process of collecting, cleaning, sorting, and processing raw data to extract relevant and valuable information to help ...
Read more >
Analyze Data in Excel - Microsoft Support
Analyze Data in Excel empowers you to understand your data through high-level visual summaries, trends, and patterns. Simply click a cell in a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found