Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid memory leaks and other tensorflow issues #68

Merged
merged 3 commits into from
Dec 12, 2023

Conversation

kmaziarz
Copy link
Collaborator

@kmaziarz kmaziarz commented Dec 8, 2023

This PR addresses two sources of memory leaks apparent when repeatedly encoding many molecules in a loop, both originating from tensorflow:

  • First, there is a very mild leak, caused by tensorflow not fully cleaning up some of its internals, which appears across many tensorflow versions.
  • Second, there is also a bigger leak introduced in tensorflow vesion 2.10.

The first issue is addressed by manually clearing _py_funcs_used_in_graph, while for the second I temporarily pin the supported tensorflow version to <2.10, awaiting the issue to be fixed upstream. The pin also avoids backward compatibility problems that start to appear in 2.14 and prevent the pretrained checkpoint from being loaded (see #67).

@kmaziarz kmaziarz merged commit 5fa9c3c into main Dec 12, 2023
4 of 5 checks passed
@kmaziarz kmaziarz deleted the kmaziarz/fix-memory-leak branch December 12, 2023 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants