I am using RLBench/PyRep to apply various textures to objects in my scene.
However, the memory usage constantly increases until at some point the simulation runs very slowly before it crashes at the end.
As you can see here (https://github.com/stepjam/RLBench/blob ... n_scene.py) in the this function
Code: Select all
def _randomize(self):
tree = self._active_task.get_base().get_objects_in_tree(
ObjectType.SHAPE)
tree = [Shape(obj.get_handle()) for obj in tree + self._scene_objects]
if self._visual_rand_config is not None:
files = self._visual_rand_config.sample(len(tree))
for file, obj in zip(files, tree):
if self._visual_rand_config.should_randomize(obj.get_name()):
text_ob, texture = self._pyrep.create_texture(file)
try:
obj.set_texture(texture, **TEX_KWARGS)
except RuntimeError:
ungrouped = obj.ungroup()
for o in ungrouped:
o.set_texture(texture, **TEX_KWARGS)
self._pyrep.group_objects(ungrouped)
text_ob.remove()
set_texture()
methods seems to be the one using that much memory as I have commented it out and everything seemed to run fine (while still creating a new texture at every iteration). The latter is triggering yoursimSetShapeTexture()
method.I think this the same issue mentioned here
(/https://github.com/stepjam/PyRep/issues/219).
I would really appreciate any help. Thanks in advance!
Best,
Firas