Fixes error with custom scalars, fixes #20579#20580
Closed
baldassarreFe wants to merge 1 commit intopytorch:masterfrom
Closed
Fixes error with custom scalars, fixes #20579#20580baldassarreFe wants to merge 1 commit intopytorch:masterfrom
baldassarreFe wants to merge 1 commit intopytorch:masterfrom
Conversation
When adding custom scalars like this
```python
from torch.utils.tensorboard import SummaryWriter
with SummaryWriter() as writer:
writer.add_custom_scalars({'Stuff': {
'Losses': ['MultiLine', ['loss/(one|two)']],
'Metrics': ['MultiLine', ['metric/(three|four)']],
}})
```
This error is raised:
```
TypeError: Parameter to MergeFrom() must be instance of same class: expected tensorboard.SummaryMetadata.PluginData got list.
```
Removing the square brackets around `SummaryMetadata.PluginData(plugin_name='custom_scalars')` should be enough to fix it.
Contributor
facebook-github-bot
left a comment
There was a problem hiding this comment.
@orionr is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Contributor
facebook-github-bot
pushed a commit
that referenced
this pull request
May 28, 2019
Summary: As a part of #20580 I noticed that we had some unusual variable naming in `summary.py`. This cleans it up and also removes some variables that weren't being used. I'll wait until we have an `add_custom_scalars` test to land this. cc lanpa natalialunova Pull Request resolved: #20861 Differential Revision: D15503420 Pulled By: orionr fbshipit-source-id: 86d105a346198a1ca543d1c5d297804402ab5a0c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When adding custom scalars like this
This error is raised:
Removing the square brackets around
SummaryMetadata.PluginData(plugin_name='custom_scalars')should be enough to fix it.