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 broken GraphView #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dmadisetti
Copy link

A common endpoint for viewing graphs in notebooks was: http://tensorboard.appspot.com/tf-graph-basic.build.html

Note that this link is now dead! I'm not sure whether this code was modified from appspot app or visa versa, but it it the only living copy of tf-graph-basic.build.html I can find. As of recent chrome updates <link rel=X> for importing HTML does not work, as such we move the polymer definitions into the file and pass the data as a base64 encoded location.hash. This method also allows for hosting the static page off server (work around for coors).

Note that GET requests are limited in size, thus super large graphs will NOT be visible. However, this was more a "trying to figure out what's wrong" rather than a "let's come up with a permanent fix", and meets my purposes.

NOTE: Tensorflow 2 exposes a tensorboard magic that lets you encode an entire tensorboard into a notebook. However this is way better imo (less cluttered, doesn't require a server).

strip_def = strip_consts(graph_def, max_const_size=max_const_size)
data = b64encode(str(strip_def).encode()).decode()
id = str(np.random.rand())
page = "https://raw.githack.com/AnotherGroupChat/Machine-Learning/dmadisetti-patch-1/tf-graph/tf-graph-basic.build.html"
Copy link
Author

Choose a reason for hiding this comment

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

Woops. Obviously will change this, but looks like this project is stale anyway

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.

1 participant