Views
No views yet
| folder | # checkpoints | frames per checkpoint |
|---|---|---|
blind/ | 35 (0..34) | 10.06 M |
coarse/ | 50 (0..49) | 5.0 M |
foveated/ | 50 (0..49) | 5.0 M |
foveated_logpolar/ | 50 (0..49) | 5.0 M |
uniform/ | 50 (0..49) | 5.0 M |
frames per ckpt differs across folders, so to align at the same training
step, convert ckpt index to absolute frame count (blind/ckpt.20.pth ≈
coarse/ckpt.40.pth ≈ 200 M frames).1import torch
2from huggingface_hub import hf_hub_download
3
4ckpt_path = hf_hub_download(
5 repo_id="alunxu/spatial-memory-checkpoints",
6 filename="foveated/ckpt.49.pth",
7)
8ckpt = torch.load(ckpt_path, map_location="cpu", weights_only=False)
9state_dict = ckpt["state_dict"]
10config = ckpt["config"].pth is a habitat-baselines checkpoint with keys state_dict,
config, and extra_state.1from habitat_baselines.common.baseline_registry import baseline_registry
2
3# Build env from ckpt's config (env_config = config.habitat).
4policy_cls = baseline_registry.get_policy(
5 config.habitat_baselines.rl.policy.name)
6policy = policy_cls.from_config(
7 config=config,
8 observation_space=env.observation_space,
9 action_space=env.action_space,
10)
11policy.load_state_dict(state_dict)
12policy.eval()
13
14# policy.act(...) returns (action, recurrent_hidden_states) where
15# recurrent_hidden_states has shape (num_envs, num_layers, hidden_dim).
16# Pass it back at the next step to keep the recurrent state.