Skip to content

Commit 9b5d6df

Browse files
committed
fix imageio
1 parent 27c5c72 commit 9b5d6df

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/xminigrid/experimental/img_obs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def build_cache(tiles: np.ndarray, tile_size: int = 32) -> tuple[np.ndarray, np.
5454
TILE_CACHE = jnp.asarray(TILE_CACHE).reshape(-1, TILE_SIZE, TILE_SIZE, 3)
5555
TILE_W_AGENT_CACHE = jnp.asarray(TILE_W_AGENT_CACHE).reshape(-1, TILE_SIZE, TILE_SIZE, 3)
5656

57-
print("Done. Cache will be reused on consequent runs.")
57+
print(f"Done. Cache is saved to {cache_path} and will be reused on consequent runs.")
5858
save_bz2_pickle({"tile_cache": TILE_CACHE, "tile_agent_cache": TILE_W_AGENT_CACHE}, cache_path)
5959

6060
TILE_CACHE = load_bz2_pickle(cache_path)["tile_cache"]

src/xminigrid/manual_control.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import argparse
44
import os
55

6-
import imageio
6+
import imageio.v3 as iio
77
import jax
88
import numpy as np
99
import pygame
@@ -167,7 +167,7 @@ def close(self) -> None:
167167
if self.save_video:
168168
assert self.video_path is not None
169169
save_path = os.path.join(self.video_path, "manual_control_rollout.mp4")
170-
imageio.mimsave(save_path, self.frames, fps=8, format="mp4")
170+
iio.imwrite(save_path, self.frames, format_hint=".mp4", fps=8)
171171

172172

173173
if __name__ == "__main__":

0 commit comments

Comments
 (0)