zswang666/softzoo

About using multiple environments in a program

Closed this issue · 2 comments

Hi! When I want to use multiple environments in my program, like the following code:

TRAINENVS=["ground", "wetland", "ice", "shallow_water"]
for i in range(len(TRAINENVS)):
        ti.init(arch=ti.gpu,device_memory_fraction=0.8)
        individual_args={"env_config_file": f"{TRAINENVS[i]}.yaml",
                        "annotated_pcd_path": f"./softzoo/assets/meshes/pcd/panda.pcd"}
        for k, v in individual_args.items():
            setattr(args, k, v)
        env = make_env(args)

       # Doing some training under this env

When I finish a training round and start training in the next environment, I found that the memory of the program increases. Is there any way to free up memory occupied by a previous environment? Otherwise the computer's memory will overflow.

Thx!

try ti.reset()?

try ti.reset()?

thx! I will try