From 1c15f0eee72778edfe797b879b77606ab913fa21 Mon Sep 17 00:00:00 2001 From: Qiushi Pan <17402261+qqhann@users.noreply.github.com> Date: Tue, 7 Dec 2021 22:59:29 +0900 Subject: [PATCH] fix: when first run, ckpt_suffixes is empty --- .../batch_rl/fixed_replay/replay_memory/fixed_replay_buffer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atari/batch_rl/fixed_replay/replay_memory/fixed_replay_buffer.py b/atari/batch_rl/fixed_replay/replay_memory/fixed_replay_buffer.py index d393a2f..9cf2c1a 100644 --- a/atari/batch_rl/fixed_replay/replay_memory/fixed_replay_buffer.py +++ b/atari/batch_rl/fixed_replay/replay_memory/fixed_replay_buffer.py @@ -162,7 +162,7 @@ def _load_replay_buffers(self, num_buffers=None): # Should contain the files for add_count, action, observation, reward, # terminal and invalid_range ckpt_suffixes = [x for x in ckpt_counters if ckpt_counters[x] in [6, 7]] - if num_buffers is not None: + if num_buffers is not None and len(ckpt_suffixes) > 0: ckpt_suffixes = np.random.choice( ckpt_suffixes, num_buffers, replace=False) self._replay_buffers = []