Open roger-creus opened 1 year ago
In the example in the documentation here RE3 crashes in re3.py - line 174 when self.k > self.idx. This can happen when the storage size has been reached and self.idx starts from 0 again. This is the line:
re3.py
self.k > self.idx
self.idx
intrinsic_rewards[:, i] = th.log(th.kthvalue(dist, self.k + 1, dim=1).values + 1.0)
from rllte.agent import PPO from rllte.env import make_envpool_atari_env from rllte.xplore.reward import RE3 if __name__ == "__main__": # env setup device = "cuda:0" env = make_envpool_atari_env(device=device, num_envs=8) # create agent agent = PPO(env=env, device=device, tag="ppo_atari") # create intrinsic reward re3 = RE3(observation_space=env.observation_space, action_space=env.action_space, device=device, num_envs=8, storage_size=100 ) # set the module agent.set(reward=re3) # start training agent.train(num_train_steps=5000)
IndexError: kthvalue(): Expected reduction dim 1 to have non-zero size.
No response
Thanks for your report! I will check it asap.
🐛 Bug
In the example in the documentation here RE3 crashes in
re3.py
- line 174 whenself.k > self.idx
. This can happen when the storage size has been reached andself.idx
starts from 0 again. This is the line:intrinsic_rewards[:, i] = th.log(th.kthvalue(dist, self.k + 1, dim=1).values + 1.0)
To Reproduce
Relevant log output / Error message
System Info
No response
Checklist