From f8c235ce8d9d3a15b6b22646ccd40ab61d58010a Mon Sep 17 00:00:00 2001 From: alexhernandezgarcia Date: Tue, 11 Jun 2024 15:13:13 -0400 Subject: [PATCH] Buffer: Handle case where logger is None --- gflownet/utils/buffer.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gflownet/utils/buffer.py b/gflownet/utils/buffer.py index b2f41ac90..1593c48ee 100644 --- a/gflownet/utils/buffer.py +++ b/gflownet/utils/buffer.py @@ -28,7 +28,11 @@ def __init__( logger=None, **kwargs, ): - self.datadir = logger.datadir + if logger is not None: + self.datadir = logger.datadir + else: + self.datadir = Path("./logs") + self.datadir.mkdir(parents=True, exist_ok=True) self.env = env self.proxy = proxy self.replay_capacity = replay_capacity