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

logger fixes: close streams and persist during warm start #763

Merged
merged 7 commits into from
Dec 6, 2024

Conversation

BrotherHa
Copy link
Contributor

Hallo,

I have added an abstract 'dummy' method to close the logger in instance to AbstractLoggerSpec and a method with the same function for the TensorboardLoggerSpec. The method is called in sr.py after the logging file is completed. This enables the use of the parameter overwrite = True for the TensorBoardLoggerSpec and solves issue (Closes #761) .

Best regards

BrotherHa and others added 4 commits December 4, 2024 10:03
Added close method to logger_specs.py
Close logger at the end of run.
pysr/logger_specs.py Outdated Show resolved Hide resolved
@MilesCranmer
Copy link
Owner

I'm confused because according to this: JuliaLogging/TensorBoardLogger.jl#109, this file closing should already happen automatically? So I am not sure why it does not in our case.

Also it should call Base.close rather than looping through the files

@BrotherHa
Copy link
Contributor Author

Effectively I reimplemented the Base.close method as close_logger to call it from logger_spec.py. If it is possible to call the Base.close method directly from logger_spec.py that would definitely be the better option.

@BrotherHa
Copy link
Contributor Author

BrotherHa commented Dec 4, 2024

Concerning JuliaLogging/TensorBoardLogger.jl/109 I am not sure, why it does not close the logger, but if possible it would be great to already solve this issue on the level of the underlying Julia-code I think.

@MilesCranmer
Copy link
Owner

Effectively I reimplemented the Base.close method as close_logger to call it from logger_spec.py. If it is possible to call the Base.close method directly from logger_spec.py that would definitely be the better option.

I think you can do jl.close?

@MilesCranmer MilesCranmer changed the title Close Logger instance after run and release handels for logging file logger fixes: close streams and persist during warm start Dec 6, 2024
@coveralls
Copy link

Pull Request Test Coverage Report for Build 12206177822

Details

  • 12 of 12 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.05%) to 93.568%

Totals Coverage Status
Change from base Build 12203983899: 0.05%
Covered Lines: 1382
Relevant Lines: 1477

💛 - Coveralls

@MilesCranmer MilesCranmer merged commit 5569ef0 into MilesCranmer:master Dec 6, 2024
18 checks passed
@MilesCranmer
Copy link
Owner

Thanks @BrotherHa!

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.

[BUG]: Overwrite of Tensorboard logging file does not work
3 participants