Skip to content

Running out of memory, how to split up computation #125

Closed Answered by blooop
blooop asked this question in Software Q&A
Discussion options

You must be logged in to vote

I think that answers my question.

This is the solution I have, although I still don't really like it:

def ik(self, frame_list: List[np.ndarray], pos_only: bool = False) -> IKResult:
        """Take a numpy list of 4x4 homogenious matrices and return an IKResult with the solution for each frame"""
        from more_itertools import chunked

        results = []
        for it, chunk in enumerate(chunked(frame_list, 200)):
            if pos_only:
                pose = self.pos(chunk)
            else:
                pose = self.pose_tensor(chunk)
            print(f"solving chunk {it}")
            results.append(self.ik_solver.solve_batch(pose))
        if len(results) == 1:
           …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by balakumar-s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants