Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

RuntimeError: Error(s) in loading state_dict for Mapper: #46

Open
marcopremigit opened this issue Feb 15, 2022 · 1 comment
Open

RuntimeError: Error(s) in loading state_dict for Mapper: #46

marcopremigit opened this issue Feb 15, 2022 · 1 comment

Comments

@marcopremigit
Copy link

marcopremigit commented Feb 15, 2022

Hi,
I'm trying to evaluate OccAnt(depth) checkpoint ([ckpt.11.pth]) using the yaml file ppo_navigation_evaluate_noisy.yaml provided https://github.com/facebookresearch/OccupancyAnticipation/blob/main/configs/model_configs/occant_depth/ppo_navigation_evaluate_noisy.yaml.
The problem is that it outputs:
I0215 15:12:23.423159 3373 simulator.py:170] Loaded navmesh data/scene_datasets/gibson/Cantwell.navmesh 2022-02-15 15:12:23,426 Initializing task Nav-v0 Traceback (most recent call last): File "run.py", line 70, in <module> main() File "run.py", line 39, in main run_exp(**vars(args)) File "run.py", line 66, in run_exp trainer.eval() File "/OccupancyAnticipation/environments/habitat/habitat-api/habitat_baselines/common/base_trainer.py", line 109, in eval checkpoint_index=prev_ckpt_ind, File "/OccupancyAnticipation/occant_baselines/rl/occant_nav_trainer.py", line 302, in _eval_checkpoint self.mapper.load_state_dict(mapper_dict, strict=False) File "/custom/conda/lib/python3.7/site-packages/torch/nn/modules/module.py", line 845, in load_state_dict self.__class__.__name__, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for Mapper: size mismatch for projection_unit.main.main.gp_depth_proj_encoder.inc.conv.conv.0.weight: copying a param with shape torch.Size([64, 2, 3, 3]) from checkpoint, the shape in current model is torch.Size([16, 2, 3, 3]). size mismatch for projection_unit.main.main.gp_depth_proj_encoder.inc.conv.conv.0.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([16]). size mismatch for projection_unit.main.main.gp_depth_proj_encoder.inc.conv.conv.1.weight: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([16]). size mismatch for projection_unit.main.main.gp_depth_proj_encoder.inc.conv.conv.1.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([16]). size mismatch for projection_unit.main.main.gp_depth_proj_encoder.inc.conv.conv.1.running_mean: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([16]).
`
and so on.
If I use the same checkpoints for exploration with ppo_exploration_evaluate_noisy.yaml everything is perfect!
What can be the problem?

@GuoPingPan
Copy link

I think it is because the channels between pretained model and evaluation config dosen't match.
you can set unet_nsf=64 in https://github.com/facebookresearch/OccupancyAnticipation/blob/main/configs/model_configs/occant_depth/ppo_navigation_evaluate_noisy.yaml.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants