fix: logger accepts arrays as data and use tensorboard_logger Logger #131
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
I was running experiments with MuZero when I ran into some errors with the loggers. I made changes so that the logger accepts Jax arrays as data to log and uses a tensorboard_logger Logger object instead of a global variable.
Why?
Somehow, a Jax array gets passed as input to the logger every so often, resulting in an error.
When using Hydra to perform multiple runs with the Tensorboard logger enabled, an error occurs on the second run due to the logger from the previous run existing and already being configured because it is based on a global variable in the tensorboard_logger library.
How?
In the case that a Jax array gets passed to the logger, it converts it to a scalar.
By using an instance of the Logger class instead of a global variable, the Tensorboard logger properly goes out of scope between runs.
Extra
I also had issues with running the commit linter step when making the commit because it would say "Please add rules to your
commitlint.config.js
". Making this change to the dependencies resolved it. I'm not sure if it's an issue on my end or not, although I did follow the steps for installing the pre-commit hooks.