facebookresearch / habitat-challenge

Code for the habitat challenge
https://aihabitat.org
MIT License
307 stars 56 forks source link

Can not run pretrained weights of ObjectNav #167

Closed elicassion closed 1 year ago

elicassion commented 1 year ago

Hi,

I'm trying to run the pretrained weights from https://dl.fbaipublicfiles.com/habitat/data/baselines/v1/objectnav_v2_baseline_habitat_navigation_challenge_2023.pth but getting:

RuntimeError: Error(s) in loading state_dict for PPO:
        Missing key(s) in state_dict: "actor_critic.net.prev_action_embedding.bias", "actor_critic.action_distribution.mu_maybe_std.weight", "actor_critic.action_distribution.mu_maybe_std.bias".
        Unexpected key(s) in state_dict: "actor_critic.action_distribution.linear.weight", "actor_critic.action_distribution.linear.bias".
        size mismatch for actor_critic.net.prev_action_embedding.weight: copying a param with shape torch.Size([7, 32]) from checkpoint, the shape in current model is torch.Size([32, 6]).

The running script I am using is

python -u -m habitat_baselines.run \
    --config-name="ddppo_objectnav_v2_hm3d_stretch.yaml" \
    habitat_baselines.evaluate=True \
    habitat_baselines.eval_ckpt_path_dir="data/pretrained_checkpoints" \
    habitat.dataset.split=val \

which is specified at starter-code

ykarmesh commented 1 year ago

We have provided you with the discrete action agent but it looks like you aren't passing config params required to use the agent to the model. Please take a look here. These are the set of configs that we are passing to get the discrete action agent working:

    bash submission.sh \
    --model-path demo.ckpt.pth \
    --input-type rgbd \
    --task objectnav \
    --action_space discrete_waypoint_controller \
    --task-config configs/ddppo_objectnav_v2_hm3d_stretch.yaml \
    habitat_baselines.rl.policy.action_distribution_type=categorical \
    habitat_baselines.load_resume_state_config=True" \
elicassion commented 1 year ago

Thanks! Yes it was the action space problem and it works now. Sorry for the late reply.

etri-jeon0123 commented 1 year ago

Thanks! Yes it was the action space problem and it works now. Sorry for the late reply.

How did you fix the error caused by the lack of "action_space_config"?