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

Close read-only runs #2844

Open
YodaEmbedding opened this issue Jun 16, 2023 · 0 comments
Open

Close read-only runs #2844

YodaEmbedding opened this issue Jun 16, 2023 · 0 comments
Labels
help wanted Extra attention is needed type / bug Issue type: something isn't working

Comments

@YodaEmbedding
Copy link
Contributor

YodaEmbedding commented Jun 16, 2023

🐛 Bug

Read-only runs give an error when close() is called:

    run.close()
  File "/home/mulhaq/.cache/pypoetry/virtualenvs/compressai-trainer-KZXCvdxM-py3.10/lib/python3.10/site-packages/aim/sdk/run.py", line 695, in close
    self._tracker.sequence_infos.clear()
AttributeError: 'RunTracker' object has no attribute 'sequence_infos'

To reproduce

import aim

def to_hash(run):
    run.close()  # Close each run to prevent "too many open files" error.
    print(run.hash)
    return run.hash

repo = aim.Repo(".")
run_hashes = [to_hash(run) for run in repo.iter_runs()]

Workaround:

import aim

def close_run(self):
    if self._resources is None:
        return
    self._resources.close()

    if not self.read_only:  # FIX
        self._tracker.sequence_infos.clear()

    # de-reference trees and other resources
    del self._resources
    del self._props
    self._resources = None
    self._props = None
    self._cleanup_trees()

def to_hash(run):
    close_run(run)  # Close each run to prevent "too many open files" error.
    print(run.hash)
    return run.hash

repo = aim.Repo(".")
run_hashes = [to_hash(run) for run in repo.iter_runs()]

Expected behavior

No error.

Environment

  • Aim Version: 3.17.5
  • Python version: 3.11
  • pip version: 23.x
  • OS: Arch Linux btw
  • Any other relevant information

Additional context

N/A

@YodaEmbedding YodaEmbedding added help wanted Extra attention is needed type / bug Issue type: something isn't working labels Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed type / bug Issue type: something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant