Skip to content

Commit 2a85cd9

Browse files
committed
[Nit] Stack video frames before transpose
1 parent 1088fc3 commit 2a85cd9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

benchmarl/experiment/logger.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,11 @@ def log_evaluation(
224224

225225
self.log(to_log, step=step)
226226
if video_frames is not None and rollouts[0].batch_size[0] > 1:
227+
video_frames = np.stack(
228+
video_frames[: rollouts[0].batch_size[0] - 1], axis=0
229+
)
227230
vid = torch.tensor(
228-
np.transpose(
229-
video_frames[: rollouts[0].batch_size[0] - 1], (0, 3, 1, 2)
230-
),
231+
np.transpose(video_frames, (0, 3, 1, 2)),
231232
dtype=torch.uint8,
232233
).unsqueeze(0)
233234
for logger in self.loggers:

0 commit comments

Comments
 (0)