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 error in tensorboard plotting #896

Merged
merged 1 commit into from
Dec 1, 2023
Merged

Fix error in tensorboard plotting #896

merged 1 commit into from
Dec 1, 2023

Conversation

michaeldeistler
Copy link
Contributor

@michaeldeistler michaeldeistler commented Dec 1, 2023

@lappalainenj FYI. I tried with older versions of torch and with older versions of sbi and it always broke so assume that this bug happened a while ago (not sure if it happened with a version bump of torch or with sbi). Let me know if you know a more elegant fix!
Screenshot 2023-11-30 at 19 45 11

_type = type(data[0])
for attribute in inspect.getfullargspec(_type).args:
if not attribute.startswith("_"):
if not attribute.startswith("_") and not attribute == "self":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure when this happened but probably when tensorboard changed their event accumulator api from namedtuples to dataclass (which then causes the additional "self" attribute in the argspec). So this fix would do it! 👍
For reference, old event accumulator api https://github.com/tensorflow/tensorboard/blob/b84f3738032277894c6f3fd3e011f032a89d002c/tensorboard/backend/event_processing/event_accumulator.py#L37
and new api
https://github.com/tensorflow/tensorboard/blob/517a57e1c188f66006d201427e599b908465f5ba/tensorboard/backend/event_processing/event_accumulator.py#L43

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, nice, thanks for the references!

Copy link
Contributor

@lappalainenj lappalainenj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approve

@michaeldeistler michaeldeistler merged commit 618a262 into main Dec 1, 2023
1 check failed
@janfb janfb deleted the tensor branch February 13, 2024 09:13
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.

2 participants