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

graph: fix bug in parsing of _output_shapes attr #4867

Merged
merged 1 commit into from
Apr 15, 2021

Conversation

nfelt
Copy link
Contributor

@nfelt nfelt commented Apr 14, 2021

This fixes an issue where the Graph dashboard would die with "Graph: Failed Normalizing names" when trying to parse a graphdef containing a node with a mis-formatted _output_shapes attr. In particular, it fails if the _output_shapes attr doesn't contain the top-level list property (either it's empty, or has only other properties). The fix is just to guard the logic by checking for that property's existence before dereferencing it.

This attr is generated when calling as_graph_def(add_shapes=True) and I'm pretty sure that when constructed normally it should always have the .list.shape property if it's present on the node at all:

However, it seems like occasionally users end up with an attr value where that isn't the case, and even in those cases we should avoid breaking the graph visualization.

Googlers, see b/160928542.

@nfelt nfelt requested a review from psybuzz April 14, 2021 17:32
@google-cla google-cla bot added the cla: yes label Apr 14, 2021
Copy link
Contributor

@psybuzz psybuzz left a comment

Choose a reason for hiding this comment

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

Thanks for the fix and adding a test!

@nfelt nfelt merged commit eabe23b into master Apr 15, 2021
@nfelt nfelt deleted the nfelt-fix-graph-outputshapes branch April 15, 2021 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants