Giter Site home page Giter Site logo

Comments (2)

mihran113 avatar mihran113 commented on September 12, 2024 1

Hey @luispsantos! Thanks a lot for opening the issue. The resource cleanup is a kind of a messy area currently, as we have done some magic tricks to close the run resources implicitly as well. We'll revisit that in the upcoming releases as we have some other issues there as well. But for now the below script should do the job:

from aim import Run, Repo

repo = Repo.from_path('.')
run = Run(repo=repo)
exception_occurred = False
try:
    ...  # complex code for ML experiments
    1 / 0  # simulate exception being raised
except:
    exception_occurred = True
finally:
    run.finalize()
    run.close()
    run_hash = run.hash
    run = None
    if exception_occurred:
        repo.delete_run(run_hash)
        print(f"Run {run_hash} discarded")

from aim.

luispsantos avatar luispsantos commented on September 12, 2024 1

Hi @mihran113. Thanks a lot for your fix, this indeed fixed my issue! The current way of discarding runs is not very straightforward in my opinion, but I guess there'll be a rework of this on future releases. We can close this ticket 👍

from aim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.