A visualization tool to show a TensorFlow's graph like TensorBoard

Overview

tfgraphviz

GitHub license

tfgraphviz is a module to visualize a TensorFlow's data flow graph like TensorBoard using Graphviz. tfgraphviz enables to provide a visualization of tensorflow graph on Jupyter Notebook without TensorBoard.

Links

Installation

Use pip to install:

$ pip install graphviz
$ pip install tfgraphviz

The only dependency is Graphviz.

macOS:

$ brew install graphviz

Ubuntu:

$ apt-get install graphviz

Quickstart

import tensorflow as tf
import tfgraphviz as tfg

g = tf.Graph()
with g.as_default():
    a = tf.constant(1, name="a")
    b = tf.constant(2, name="b")
    c = tf.add(a, b, name="add")
tfg.board(g)

https://raw.githubusercontent.com/akimach/tfgraphviz/master/img/graph.jpg

License

This package is distributed under the MIT license.

Author

Akimasa KIMURA

Comments
  • Add Binder support

    Add Binder support

    To get the example working in Binder the only required pip installable package is tensorflow and from apt-get is graphviz. The postBuild will install tfgraphviz from GitHub so that it always gets the master HEAD, so that if there is something broken for a bit on PyPI it won't continue to be a problem until a new release is made.

    opened by matthewfeickert 2
  • added pan and zoom support for jupyter

    added pan and zoom support for jupyter

    Added tfg.jupyter_pan_and_zoom helper to wrap generated SVG object In order to enable pan and zoom functionality in Jupyter:

    tfg.jupyter_pan_and_zoom(tfg.board(graph))
    

    Tested in JupyterLab and Colab.

    opened by vlasenkoalexey 1
  • Extending functionality

    Extending functionality

    • Added proper tooltips
    • Fixed logic to render function names to check op type, not op name
    • Added ability to override functions to create digraph, node and edge like:
    def custom_add_digraph_node(digraph, name, op, attributes=None):
        attributes=[]
        if op is not None and 'PartitionedCall' in op.type:
            attributes.append(('fillcolor', 'blue'))
        tfg.add_digraph_node(digraph, name, op, attributes)
    
    tfg.board(tf_g, depth=10, name_regex=".*", add_digraph_node_func=custom_add_digraph_node)
    
    opened by vlasenkoalexey 1
  • For Python3.x

    For Python3.x

    Fixed to work on Python 3.x:

    • Change IMPLICIT relative imports (from graphviz_wrapper import board) to EXPLICIT relative imports (from .graphviz_wrapper import board).
    • (In addition, ) remove unnecessary imports.

    Checked to work both Python 2.7.x/3.5.x with TensorFlow 1.0.

    opened by antimon2 1
  • UnicodeDecodeError on loading the graph.

    UnicodeDecodeError on loading the graph.

    I am getting the following error. Is unicode in tf variable/scope names not supported?

    <ipython-input-2-b2099ef84663> in load(self)
        143         # sess = tf.Session(graph=tf.get_default_graph())
        144         self.sess.run(self.init)
    --> 145         g = tfg.board(tf.get_default_graph())
        146         g.view()
        147         self.saver.restore(self.sess, model_path)
    
    /Users/activeai/.local/share/virtualenvs/spotter-67LXOL6z/lib/python2.7/site-packages/tfgraphviz/graphviz_wrapper.pyc in board(tfgraph, depth, name, style)
        212     _node_inpt_table, _node_inpt_shape_table = node_input_table(tfgraph, depth=depth)
        213     digraph = add_nodes(_node_table, name=name, style=style)
    --> 214     digraph = add_edges(digraph, _node_inpt_table, _node_inpt_shape_table)
        215     return digraph
    
    /Users/activeai/.local/share/virtualenvs/spotter-67LXOL6z/lib/python2.7/site-packages/tfgraphviz/graphviz_wrapper.pyc in add_edges(digraph, node_inpt_table, node_inpt_shape_table)
        195             else:
        196                 shape = node_inpt_shape_table[ni]
    --> 197                 digraph.edge(ni, node, label=edge_label(shape))
        198     return digraph
        199 
    
    /Users/activeai/.local/share/virtualenvs/spotter-67LXOL6z/lib/python2.7/site-packages/graphviz/dot.pyc in edge(self, tail_name, head_name, label, _attributes, **attrs)
        145         head_name = self._quote_edge(head_name)
        146         attr_list = self._attr_list(label, attrs, _attributes)
    --> 147         line = self._edge % (tail_name, head_name, attr_list)
        148         self.body.append(line)
        149 
    
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 10: ordinal not in range(128)
    
    opened by malarinv 0
Releases(0.0.8)
PoseViz – Multi-person, multi-camera 3D human pose visualization tool built using Mayavi.

PoseViz – 3D Human Pose Visualizer Multi-person, multi-camera 3D human pose visualization tool built using Mayavi. As used in MeTRAbs visualizations.

István Sárándi 79 Dec 30, 2022
Official implementation for (Show, Attend and Distill: Knowledge Distillation via Attention-based Feature Matching, AAAI-2021)

Show, Attend and Distill: Knowledge Distillation via Attention-based Feature Matching Official pytorch implementation of "Show, Attend and Distill: Kn

Clova AI Research 80 Dec 16, 2022
We will see a basic program that is basically a hint to brute force attack to crack passwords. In other words, we will make a program to Crack Any Password Using Python. Show some ❤️ by starring this repository!

Crack Any Password Using Python We will see a basic program that is basically a hint to brute force attack to crack passwords. In other words, we will

Ananya Chatterjee 11 Dec 3, 2022
Using some basic methods to show linkages and transformations of robotic arms

roboticArmVisualizer Python GUI application to create custom linkages and adjust joint angles. In the future, I plan to add 2d inverse kinematics solv

Sandesh Banskota 1 Nov 19, 2021
Tesla Light Show xLights Guide With python

Tesla Light Show xLights Guide Welcome to the Tesla Light Show xLights guide! You can create and run your own light shows on Tesla vehicles. Running a

Tesla, Inc. 2.5k Dec 29, 2022
Locationinfo - A script helps the user to show network information such as ip address

Description This script helps the user to show network information such as ip ad

Roxcoder 1 Dec 30, 2021
Cancer-and-Tumor-Detection-Using-Inception-model - In this repo i am gonna show you how i did cancer/tumor detection in lungs using deep neural networks, specifically here the Inception model by google.

Cancer-and-Tumor-Detection-Using-Inception-model In this repo i am gonna show you how i did cancer/tumor detection in lungs using deep neural networks

Deepak Nandwani 1 Jan 1, 2022
A repo to show how to use custom dataset to train s2anet, and change backbone to resnext101

A repo to show how to use custom dataset to train s2anet, and change backbone to resnext101

jedibobo 3 Dec 28, 2022
A static analysis library for computing graph representations of Python programs suitable for use with graph neural networks.

python_graphs This package is for computing graph representations of Python programs for machine learning applications. It includes the following modu

Google Research 258 Dec 29, 2022
The source code of the paper "Understanding Graph Neural Networks from Graph Signal Denoising Perspectives"

GSDN-F and GSDN-EF This repository provides a reference implementation of GSDN-F and GSDN-EF as described in the paper "Understanding Graph Neural Net

Guoji Fu 18 Nov 14, 2022
Pytorch implementation of “Recursive Non-Autoregressive Graph-to-Graph Transformer for Dependency Parsing with Iterative Refinement”

Graph-to-Graph Transformers Self-attention models, such as Transformer, have been hugely successful in a wide range of natural language processing (NL

Idiap Research Institute 40 Aug 14, 2022
A PyTorch implementation of "Semi-Supervised Graph Classification: A Hierarchical Graph Perspective" (WWW 2019)

SEAL ⠀⠀⠀ A PyTorch implementation of Semi-Supervised Graph Classification: A Hierarchical Graph Perspective (WWW 2019) Abstract Node classification an

Benedek Rozemberczki 202 Dec 27, 2022
A weakly-supervised scene graph generation codebase. The implementation of our CVPR2021 paper ``Linguistic Structures as Weak Supervision for Visual Scene Graph Generation''

README.md shall be finished soon. WSSGG 0 Overview 1 Installation 1.1 Faster-RCNN 1.2 Language Parser 1.3 GloVe Embeddings 2 Settings 2.1 VG-GT-Graph

Keren Ye 35 Nov 20, 2022
This is an open-source toolkit for Heterogeneous Graph Neural Network(OpenHGNN) based on DGL [Deep Graph Library] and PyTorch.

This is an open-source toolkit for Heterogeneous Graph Neural Network(OpenHGNN) based on DGL [Deep Graph Library] and PyTorch.

BUPT GAMMA Lab 519 Jan 2, 2023
Apply Graph Self-Supervised Learning methods to graph-level task(TUDataset, MolculeNet Datset)

Graphlevel-SSL Overview Apply Graph Self-Supervised Learning methods to graph-level task(TUDataset, MolculeNet Dataset). It is unified framework to co

JunSeok 8 Oct 15, 2021
A PoC Corporation Relationship Knowledge Graph System on top of Nebula Graph.

Corp-Rel is a PoC of Corpartion Relationship Knowledge Graph System. It's built on top of the Open Source Graph Database: Nebula Graph with a dataset

Wey Gu 20 Dec 11, 2022
This is the repository for the AAAI 21 paper [Contrastive and Generative Graph Convolutional Networks for Graph-based Semi-Supervised Learning].

CG3 This is the repository for the AAAI 21 paper [Contrastive and Generative Graph Convolutional Networks for Graph-based Semi-Supervised Learning]. R

null 12 Oct 28, 2022