Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script crash during dataset preparation #5

Closed
ADetilie opened this issue Jul 22, 2024 · 4 comments
Closed

Script crash during dataset preparation #5

ADetilie opened this issue Jul 22, 2024 · 4 comments

Comments

@ADetilie
Copy link

ADetilie commented Jul 22, 2024

TL;DR

I am getting the following error during Habitat Matterport dataset prep:

-------------
{}
agent_state: position [13.376938    0.09943584  0.18875428] rotation quaternion(1, 0, 0, 0)
saving frame 3584/3586: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3585/3585 [03:05<00:00, 19.28it/s]
GL::Context::current(): no current context
[1]    234262 IOT instruction (core dumped)  

Steps to reproduce:

  1. I've downloaded "Downloading HM3D v0.2" from https://github.com/matterport/habitat-matterport-3dresearch
    and prepared it as described in the README.md.

See the image:
image

  1. I've modified https://github.com/hovsg/HOV-SG/blob/main/data/habitat/gen_hm3dsem_from_poses.py#L84 and https://github.com/hovsg/HOV-SG/blob/main/data/habitat/gen_hm3dsem_from_poses.py#L85 from "quite" to "verbose" in order to get more detailed error message.

  2. After that, I executed the following command:

python data/habitat/gen_hm3dsem_from_poses.py --dataset_dir <hm3dsem_dir> --save_dir data/hm3dsem_walks/

Results:

Script have been executed for some time, but in the end, it failed with the following error:

agent_state: position [13.376938    0.09943584  0.18875428] rotation quaternion(1, 0, 0, 0)
saving frame 3584/3586: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3585/3585 [03:48<00:00, 15.68it/s]
[15:40:40:663264]:[Debug]:[Physics] PhysicsManager.cpp(57)::~PhysicsManager : Deconstructing PhysicsManager
[15:40:40:663379]:[Debug]:[Scene] SceneManager.h(21)::~SceneManager : Deconstructing SceneManager
[15:40:40:663397]:[Debug]:[Scene] SceneGraph.h(25)::~SceneGraph : Deconstructing SceneGraph
[15:40:40:663973]:[Debug]:[Sensor] Sensor.cpp(68)::~Sensor : Deconstructing Sensor
[15:40:40:664186]:[Debug]:[Sensor] Sensor.cpp(68)::~Sensor : Deconstructing Sensor
[15:40:40:664413]:[Debug]:[Sensor] Sensor.cpp(68)::~Sensor : Deconstructing Sensor
[15:40:40:664608]:[Debug]:[Sensor] Sensor.cpp(68)::~Sensor : Deconstructing Sensor
[15:40:40:664647]:[Debug]:[Scene] SceneGraph.h(25)::~SceneGraph : Deconstructing SceneGraph
[15:40:40:667051]:[Debug]:[Scene] SemanticScene.h(53)::~SemanticScene : Deconstructing SemanticScene
[15:40:40:668724]:[Debug]:[Gfx] Renderer.cpp(71)::~Impl : Deconstructing Renderer
[15:40:40:668769]:[Debug]:[Gfx] WindowlessContext.h(17)::~WindowlessContext : Deconstructing WindowlessContext
[15:40:40:767203]:[Debug]:[Sim] Simulator.cpp(61)::~Simulator : Deconstructing Simulator
[15:40:40:767945]:[Debug]:[Physics] PhysicsManager.cpp(57)::~PhysicsManager : Deconstructing PhysicsManager
[15:40:40:767990]:[Debug]:[Scene] SceneManager.h(21)::~SceneManager : Deconstructing SceneManager
[15:40:40:768002]:[Debug]:[Scene] SceneGraph.h(25)::~SceneGraph : Deconstructing SceneGraph
GL::Context::current(): no current context
[1]    235042 IOT instruction (core dumped)  python data/habitat/gen_hm3dsem_from_poses.py --dataset_dir  --save_dir 

Generated data looks like this:
Screenshot 2024-07-22 at 16 43 09

Questions

Have you seen similar problems? Could you help figure out what might be the root cause of the issue? Thanks.

By the way, it seems like it might be a habitat problem. Could you specify the version of habitat you are using?

@abwerby
Copy link
Collaborator

abwerby commented Jul 22, 2024

Hello,
I have not encountered this issue before it looks like a habitat sim problem.
Does habitat-sim work with you in general?

@ADetilie
Copy link
Author

When I run Habitat with a command like:

habitat-viewer mL8ThkuaVTM.glb

I don't encounter any problems.

However, when I run the script, I get the following error at the end: GL::Context::current(): no current context.
This error doesn't affect data generation tho; the data is still written to disk.

@ADetilie
Copy link
Author

ADetilie commented Jul 23, 2024

@abwerby but I've added to the data/habitat/gen_hm3dsem_from_poses.py script the following line (line 141):

        sim.close()

after the for pose in pbar: loop.
It seems like this fixed the problem for me.

See the code snippet:

        ...
        for pose in pbar:
           pbar.set_description(f"saving frame {steps}/{len(poses_list) + 1}")
           agent = sim.get_agent(0)
           agent_state = agent.get_state()
           agent_state.sensor_states["color_sensor"].position = pose[:3]
           agent_state.sensor_states["color_sensor"].rotation = pose[3:]
           agent_state.sensor_states["depth_sensor"].position = pose[:3]
           agent_state.sensor_states["depth_sensor"].rotation = pose[3:]
           agent_state.sensor_states["semantic"].position = pose[:3]
           agent_state.sensor_states["semantic"].rotation = pose[3:]
           agent.set_state(agent_state, reset_sensors=True, infer_sensor_states=False)
           obs = sim.get_sensor_observations(0)
           rgb = obs["color_sensor"]
           depth = obs["depth_sensor"]
           depth = ((depth / 10) * 255).astype(np.uint8)
           semantic = obs["semantic"]
           # cv2.imshow("rgb", rgb)
           # cv2.imshow("depth", depth)
           # cv2.waitKey()
           save_obs(save_dir, sim_settings, obs, pose, steps)
           steps += 1
       sim.close()

@abwerby
Copy link
Collaborator

abwerby commented Jul 23, 2024

thank you for sharing your solution.

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

No branches or pull requests

3 participants