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

Fix/tensorboard incompatible with numpy 1.24 #109

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,9 @@ If you need more visualizations, use `add_scalar('tag', data)`, `add_image('tag'

**Note**: You don't have to specify current steps, since `WriterTensorboard` class defined at `logger/visualization.py` will track current steps.

**known issue**: when using numpy>=1.24 and pytorch <=1.13 may encontered Type error: No loop matching the specified signature and casting was found for ufunc greater which will fixed by following update of pytorch.

one fix is to install the pkg from source, since it has been fixed in source just havent released yet. another if following this hot fix that modify the torch/utils/tensorboard/summary.py from cum_counts = np.cumsum(np.greater(counts, 0, dtype=np.int32)) to cum_counts = np.cumsum(np.greater(counts, 0)) one can find the pkg source by clicking the import line in vscode
## Contribution
Feel free to contribute any kind of function or enhancement, here the coding style follows PEP8

Expand Down
4 changes: 4 additions & 0 deletions parse_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ def __getitem__(self, name):
"""Access items like ordinary dict."""
return self.config[name]

def __contains__(self, name):
"""Use in operation like ordinary dict."""
return name in self.config

def get_logger(self, name, verbosity=2):
msg_verbosity = 'verbosity option {} is invalid. Valid options are {}.'.format(verbosity, self.log_levels.keys())
assert verbosity in self.log_levels, msg_verbosity
Expand Down