Skip to content

[Question] Training with a large number of different objects #40

Closed

Description

@AmanuelErgogo

Question

Hi great work!

What is a possible way to clear stage and spawn a random rigid object at each episode without closing the simulator? without running into memory leaks

Thanks,

Activity

  1. Mayankm96 commented on Mar 24, 2023

    @Mayankm96
    Contributor

    Hi!

    That is a very interesting question. In principle, one can delete a prim and spawn a new prim to the stage at any time when the stage is running. So you don't need to close the simulator.

    I haven't tested this but something like this would fit your need:

    from omni.isaac.core.utils.prims import delete_prim, create_prim
    
    delete_prim("/World/envs/env_0/Object")
    create_prim("/World/envs/env_0/Object", usd_path=cfg.usd_path)

    However, spawning assets on the fly (i.e. while the simulation is playing) is somewhat risky. Whenever a new object is spawned, physics needs to allocate memory for it and then the RigidPrimView needs to be re-initialized to access the new memory created. Reinitializing the prim views can be expensive depending on how many objects are present, so definitely not a great thing to do at every new episode.

    A workaround can be that you spawn all the assets at the start and hide them far away from the scene (under the ground), and at every reset put one of them back on the table by changing their position. Not an elegant solution though.

  2. changed the title [-]training on a large number of different objects[/-] [+][Question] Training with a large number of different objects[/+] on Mar 28, 2023
  3. added
    question
    on Mar 28, 2023
  4. Mayankm96 commented on May 26, 2023

    @Mayankm96
    Contributor

    Closing the issue due to no activity. Please re-open if still unresolved.

  5. added a commit that references this issue on Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions