Skip to content

Commit 6387191

Browse files
authored
Show correct exception cause (#205)
1 parent 94a685d commit 6387191

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cleanrl/ppg_procgen.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,10 @@ def get_pi(self, x):
473473
optimizer.step()
474474
optimizer.zero_grad() # This cannot be outside, else gradients won't accumulate
475475

476-
except RuntimeError:
476+
except RuntimeError as e:
477477
raise Exception(
478478
"if running out of CUDA memory, try a higher --n-aux-grad-accum, which trades more time for less gpu memory"
479-
)
479+
) from e
480480

481481
del m_aux_obs, m_aux_returns
482482
writer.add_scalar("losses/aux/kl_loss", kl_loss.mean().item(), global_step)

0 commit comments

Comments
 (0)