8000 CompGraph class destructor not called · Issue #40 · comp-imaging/ProxImaL · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
CompGraph class destructor not called #40
Open
@timmeinhardt

Description

@timmeinhardt

For my last project I had to perform an extensive hyperparameter optimisation during which I regularly ran out of memory. After spending some time to find the memory leak, I came across the CompGraph class which has a self reference cycle. Such a cycle prevents a class from being deleted.

The problem is the self injected into the other objects in those two lines:

self.forward_log = TimingsLog(self.nodes + [self])
self.adjoint_log = TimingsLog(self.nodes + [self])

To fix the problem I changed the code to [str(self)] which then only injects a string. Since there is generally only one computational graph, time logging stills works (exact object references should only be necessary for graph elements which appear more than once). But there is probably a more elegant way to resolve this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0