facebookresearch / habitat-challenge

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

Fail To Run DDPPO Baseline: 'Box' object has no attribute 'n' #155

Closed DumbMice closed 1 year ago

DumbMice commented 1 year ago

I tried running ddppo baseline for objectnav task using ddppo_objectnav_v2_hm3d_stretch.yaml, and got the following error:

  File "/habitat-lab/habitat-baselines/habitat_baselines/rl/ppo/ppo_trainer.py", line 723, in train
    self._init_train(resume_state)
  File "/habitat-lab/habitat-baselines/habitat_baselines/rl/ppo/ppo_trainer.py", line 318, in _init_train
    self._setup_actor_critic_agent(ppo_cfg)
  File "/habitat-lab/habitat-baselines/habitat_baselines/rl/ppo/ppo_trainer.py", line 159, in _setup_actor_critic_agent
    self.actor_critic = policy.from_config(
  File "/habitat-lab/habitat-baselines/habitat_baselines/rl/ddppo/policy/resnet_policy.py", line 111, in from_config
    return cls(
  File "/habitat-lab/habitat-baselines/habitat_baselines/rl/ddppo/policy/resnet_policy.py", line 72, in __init__
    PointNavResNetNet(
  File "/habitat-lab/habitat-baselines/habitat_baselines/rl/ddppo/policy/resnet_policy.py", line 265, in __init__
    action_space.n + 1, self._n_prev_action
AttributeError: 'Box' object has no attribute 'n'
Exception ignored in: <function VectorEnv.__del__ at 0x7f2d8f3dca60>
Traceback (most recent call last):
  File "/habitat-lab/habitat-lab/habitat/core/vector_env.py", line 589, in __del__
  File "/habitat-lab/habitat-lab/habitat/core/vector_env.py", line 460, in close
  File "/habitat-lab/habitat-lab/habitat/core/vector_env.py", line 129, in __call__
  File "/habitat-lab/habitat-lab/habitat/utils/pickle5_multiprocessing.py", line 63, in send
  File "/opt/conda/envs/habitat/lib/python3.8/multiprocessing/connection.py", line 200, in send_bytes
  File "/opt/conda/envs/habitat/lib/python3.8/multiprocessing/connection.py", line 411, in _send_bytes
  File "/opt/conda/envs/habitat/lib/python3.8/multiprocessing/connection.py", line 368, in _send
BrokenPipeError: [Errno 32] Broken pipe

I've piped stdout and stderr messages to this log file: habitat.log According to https://github.com/openai/gym/issues/839,

It is not valid for a continous space of type Box to have a finite number of elements n, thus the property doesn't exist.

Perhaps this is due to version conflicts among habitat repos and openai gym? This is a list of related packages in my conda env:

gym                       0.23.0                   pypi_0    pypi
gym-notices               0.0.8                    pypi_0    pypi
habitat-baselines         0.2.3                     dev_0    <develop>
habitat-lab               0.2.3                     dev_0    <develop>
habitat-sim               0.2.3                    pypi_0    pypi
habitat-sim-challenge-2023 0.2.3           py3.8_headless_linux_bc7e273926654aac007b421819a3050
61cc72510    aihabitat
habitat-sim-mutex         1.0             headless_nobullet    aihabitat
headless                  2.0                           0    aihabitat
ykarmesh commented 1 year ago

@ASzot Can you take a look.

DumbMice commented 1 year ago

Turns out I mistakenly put _self_ at the start of the default list in ddppo_objectnav_v2_hm3d_stretch.yaml. Putting _self_ back at the last position fixed the problem.