google-deepmind/envlogger

Random agent catch does not run.

Closed this issue · 2 comments

Hi!
When I run the random_agent_catch.py file, there seems to some kind of RuntimeError saying that no such file /tmp/catch_data/metadata.riegeli exists and quits right after that. Even when building and testing with Bazel, it seems to fail at the same metadata.riegeli does not exists RuntimeError.

Am I doing something wrong in setting the repo up?
Screenshot from 2024-08-02 10-40-03

Hello @Itssshikhar, thanks for opening this bug!

Can you try creating the directory before running EnvLogger?

mkdir /tmp/catch_data/

The code is expected to fail if the directory doesn't exist before instantiating the logger. Please see these lines:

// Initializes this writer to the following `data_dir`.
// `metadata` is a client-specific payload.
// `max_episodes_per_shard` determines the maximum number of episodes a single
// RiegeliShardWriter shard will hold. If non-positive, a single shard file
// will hold all steps and episodes.
// `episode_counter` sets the current episode that this writer is processing.
// It influences the shards that are created if `max_episodes_per_shard` is
// positive.
//
// IMPORTANT: `data_dir` MUST exist _before_ calling Init().

I can see that the info is only present in C++, but not in Python. I'll see if I can add a sentence to the docs, and also to the README.

Cheers,

Daniel

Hey @kenjitoyama! Thanks for the heads up.

Was able to solve this issue precisely by creating a catch_data directory in /tmp/.

Cheers,
Shikhar