Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

How to generate csv files? #212

Closed
cjdjr opened this issue Jul 14, 2021 · 4 comments
Closed

How to generate csv files? #212

cjdjr opened this issue Jul 14, 2021 · 4 comments

Comments

@cjdjr
Copy link

cjdjr commented Jul 14, 2021

I tried to analyze the behavior of the agent through the dashboard. But a csv file is required to run the dashboard, how to generate csv files ?

@mwbyeon
Copy link

mwbyeon commented Jul 29, 2021

@cjdjr That's disabled in the code :(

nle/nle/env/base.py

Lines 282 to 284 in b85184f

# TODO: Fix stats_file logic.
# self._setup_statsfile = self.savedir is not None
self._setup_statsfile = False

nle/nle/env/base.py

Lines 466 to 476 in b85184f

if self._setup_statsfile:
filename = os.path.join(self.savedir, "stats.csv")
add_header = not os.path.exists(filename)
self._stats_file = open(filename, "a", 1) # line buffered.
self._stats_logger = csv.DictWriter(
self._stats_file, fieldnames=self.Stats._fields
)
if add_header:
self._stats_logger.writeheader()
self._setup_statsfile = False

@heiner
Copy link
Contributor

heiner commented Jul 29, 2021

Yes, this logic is currently disabled.

It shouldn't be too hard to produce a csv file on the agent side. The required headers are

            "end_status",
            "score",
            "time",
            "steps",
            "hp",
            "exp",
            "exp_lev",
            "gold",
            "hunger",
            "killer_name",
            "deepest_lev",
            "episode",
            "seeds",
            "ttyrec",

(The JavaScript code probably doesn't like the bz2'd ttyrecs, so you might have to un-bzip2 them (either before running the dashboard or by changing the dashboard JS.)

@mwbyeon
Copy link

mwbyeon commented Jul 29, 2021

@heiner
Thank you. Do you have any plan to develop code that generates a csv file?
I'm looking forward to it :)

@heiner
Copy link
Contributor

heiner commented Jan 26, 2022

Hey @mwbyeon, @cjdjr,

This might not be the resolution you've been looking for but we've just decided to remove the JavaScript dashboard as we haven't been maintaining it very well.

If you feel strongly about wanting to keep using the dashboard I'm happy to add more pointers at how you could do that, let me know.

@heiner heiner closed this as completed Jan 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants