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

JSONLogger bug in Basic Tour example #438

Closed
darryl34 opened this issue Jul 20, 2023 · 2 comments
Closed

JSONLogger bug in Basic Tour example #438

darryl34 opened this issue Jul 20, 2023 · 2 comments

Comments

@darryl34
Copy link

As seen in the example, we can save and load our progress with a logger file.

logger = JSONLogger(path="./logs.log")
load_logs(new_optimizer, logs=["./logs.log"])

As the specified file does not have the .json extension, it will be appended to it as seen in logger.py line 138.

class JSONLogger(_Tracker):
    def __init__(self, path, reset=True):
        self._path = path if path[-5:] == ".json" else path + ".json"

However, this causes a FileNotFoundError as the file is now "logs.log.json" instead. Perhaps a fix would be to edit the notebook and a note saying that the given file will have the .json extension added to it if its not already one.

@till-m
Copy link
Member

till-m commented Jul 20, 2023

Hi @darryl34,

I suspect the problem here is a mismatch in versions. Recently (#420), we changed the logger to not force .json as extension, and updated the notebooks correspondingly. This was primarily done since the output was not actually valid .json.
However, a version with this change not been released yet. I'm not sure what the current plan is with regard to releases. I suspect we could just make a release now, unfortunately I'm not too familiar with the process.

@darryl34
Copy link
Author

Ah okay thats great to hear! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants