facebookresearch / habitat-sim

A flexible, high-performance 3D simulator for Embodied AI research.
https://aihabitat.org/
MIT License
2.58k stars 418 forks source link

'habitat_sim._ext.habitat_sim_bindings.SimulatorConfiguration' object has no attribute 'scene_id' #981

Closed Skylark0924 closed 3 years ago

Skylark0924 commented 3 years ago

🐛 Bug

Command

Directly run the code in ECCV 2020: Navigation example on my local PC as a python script.

Additional context

System Info

/home/lab/anaconda3/envs/habitat/bin/python /home/skylark/PycharmRemote/ReGReT/Test/eccv_2020_navigation.py
Traceback (most recent call last):
  File "/home/skylark/PycharmRemote/ReGReT/Test/eccv_2020_navigation.py", line 187, in <module>
    cfg = make_simple_cfg(sim_settings)
  File "/home/skylark/PycharmRemote/ReGReT/Test/eccv_2020_navigation.py", line 169, in make_simple_cfg
    sim_cfg.scene_id = settings["scene"]
AttributeError: 'habitat_sim._ext.habitat_sim_bindings.SimulatorConfiguration' object has no attribute 'scene_id'

I wonder why I use the same version of habitat-sim (0.1.6) as the Colab, but got an error.

I look into the SimulatorConfiguration, and did not find a property called scene_id:

class SimulatorConfiguration(__pybind11_builtins.pybind11_object):
    # no doc
    def __eq__(self, arg0): # real signature unknown; restored from __doc__
        """ __eq__(self: habitat_sim._ext.habitat_sim_bindings.SimulatorConfiguration, arg0: habitat_sim._ext.habitat_sim_bindings.SimulatorConfiguration) -> bool """
        return False

    def __init__(self): # real signature unknown; restored from __doc__
        """ __init__(self: habitat_sim._ext.habitat_sim_bindings.SimulatorConfiguration) -> None """
        pass

    def __ne__(self, arg0): # real signature unknown; restored from __doc__
        """ __ne__(self: habitat_sim._ext.habitat_sim_bindings.SimulatorConfiguration, arg0: habitat_sim._ext.habitat_sim_bindings.SimulatorConfiguration) -> bool """
        return False

    allow_sliding = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default

    create_renderer = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default

    default_agent_id = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default

    default_camera_uuid = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default

    enable_physics = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default

    frustum_culling = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default

    gpu_device_id = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default

    load_semantic_mesh = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default

    physics_config_file = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default

    random_seed = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default

    requires_textures = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default

    scene = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default

    scene_light_setup = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default
Skylion007 commented 3 years ago

Your local habitat_sim is out of date. There was a breaking API change recently. Upgrading should fix it. The collabs are running the nightly versions of habitat-sim.

Skylark0924 commented 3 years ago

Your local habitat_sim is out of date. There was a breaking API change recently. Upgrading should fix it. The collabs are running the nightly versions of habitat-sim.

Thanks for your reply! Does that mean I need to reinstall the habitat-sim as a nightly version? I will try again.

Skylark0924 commented 3 years ago

Well, after updating to a nightly version, I found another script that uses habitat-lab to create an environment has reported lots of unseen errors. Seem like the habitat-lab relies on a stable version of habitat-sim.

2020-12-19 16:24:42,074 Initializing dataset ObjectNav-v1
2020-12-19 16:24:56,710 initializing sim Sim-v0
Traceback (most recent call last):
  File "/opt/pycharm-community-2019.3/plugins/python-ce/helpers/pydev/pydevd.py", line 1434, in _exec
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "/opt/pycharm-community-2019.3/plugins/python-ce/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "/home/skylark/PycharmRemote/ReGReT/Env/habitat_env.py", line 675, in <module>
    example_Regret()
  File "/home/skylark/PycharmRemote/ReGReT/Env/habitat_env.py", line 600, in example_Regret
    env = HabitatEnv(env_config)
  File "/home/skylark/PycharmRemote/ReGReT/Env/habitat_env.py", line 46, in __init__
    self.eng = NavRLEnv(config=self.config)
  File "/home/skylark/PycharmRemote/ReGReT/Env/habitat_dataset/NavRL_env.py", line 44, in __init__
    super().__init__(self._core_env_config, dataset)
  File "/home/lab/Github/habitat-lab/habitat/core/env.py", line 331, in __init__
    self._env = Env(config, dataset)
  File "/home/lab/Github/habitat-lab/habitat/core/env.py", line 105, in __init__
    id_sim=self._config.SIMULATOR.TYPE, config=self._config.SIMULATOR
  File "/home/lab/Github/habitat-lab/habitat/sims/registration.py", line 19, in make_sim
    return _sim(**kwargs)
  File "/home/lab/Github/habitat-lab/habitat/sims/habitat_simulator/habitat_simulator.py", line 182, in __init__
    self.sim_config = self.create_sim_config(self._sensor_suite)
  File "/home/lab/Github/habitat-lab/habitat/sims/habitat_simulator/habitat_simulator.py", line 198, in create_sim_config
    sim_config.scene.id = self.habitat_config.SCENE
AttributeError: 'habitat_sim._ext.habitat_sim_bindings.SimulatorCon' object has no attribute 'scene'
Exception ignored in: <bound method Simulator.__del__ of HabitatSim(config=NOTHING, agents=NOTHING, _num_total_frames=NOTHING, _default_agent_id=NOTHING, _Simulator__sensors=NOTHING, _initialized=NOTHING, _previous_step_time=NOTHING, _Simulator__last_state=NOTHING)>
Traceback (most recent call last):
  File "/home/lab/anaconda3/envs/habitat/lib/python3.6/site-packages/habitat_sim/simulator.py", line 467, in __del__
    self.close()
  File "/home/lab/anaconda3/envs/habitat/lib/python3.6/site-packages/habitat_sim/simulator.py", line 118, in close
    for agent_sensorsuite in self.__sensors:
AttributeError: 'HabitatSim' object has no attribute '_Simulator__sensors'

Process finished with exit code 1

However, I just update my habitat-lab days ago.

Skylark0924 commented 3 years ago

Update to the nightly version is actually the solution to this issue! Thanks a lot!

However, other problems may cause by the update as I wrote in the previous comment.

erikwijmans commented 3 years ago

The current stable tags for both habitat-sim and habitat-lab match with each other and are compatible, the current tip of habitat-sim and habitat-lab match, but you current can't mix and match those because of a BC breaking change between now and the last release.

Skylark0924 commented 3 years ago

@erikwijmans Then I will wait for your update about a stable version,cheer for you guys!(ง •̀_•́)ง! Lol