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)
External Attention Network

Beyond Self-attention: External Attention using Two Linear Layers for Visual Tasks paper : https://arxiv.org/abs/2105.02358 Jittor code will come soon

MenghaoGuo 357 Dec 11, 2022
ElasticFace: Elastic Margin Loss for Deep Face Recognition

This is the official repository of the paper: ElasticFace: Elastic Margin Loss for Deep Face Recognition Paper on arxiv: arxiv Model Log file Pretrain

Fadi Boutros 113 Dec 14, 2022
Using this you can control your PC/Laptop volume by Hand Gestures (pinch-in, pinch-out) created with Python.

Hand Gesture Volume Controller Using this you can control your PC/Laptop volume by Hand Gestures (pinch-in, pinch-out). Code Firstly I have created a

Tejas Prajapati 16 Sep 11, 2021
CoSMA: Convolutional Semi-Regular Mesh Autoencoder. From Paper "Mesh Convolutional Autoencoder for Semi-Regular Meshes of Different Sizes"

Mesh Convolutional Autoencoder for Semi-Regular Meshes of Different Sizes Implementation of CoSMA: Convolutional Semi-Regular Mesh Autoencoder arXiv p

Fraunhofer SCAI 10 Oct 11, 2022
The story of Chicken for Club Bing

Chicken Story tl;dr: The time when Microsoft banned my entire country for cheating at Club Bing. (A lot of the details are from memory so I've recreat

Eyal 142 May 16, 2022
[Link]deep_portfolo - Use Reforcemet earg ad Supervsed learg to Optmze portfolo allocato []

rl_portfolio This Repository uses Reinforcement Learning and Supervised learning to Optimize portfolio allocation. The goal is to make profitable agen

Deepender Singla 165 Dec 02, 2022
Official PyTorch implementation of the preprint paper "Stylized Neural Painting", accepted to CVPR 2021.

Official PyTorch implementation of the preprint paper "Stylized Neural Painting", accepted to CVPR 2021.

Zhengxia Zou 1.5k Dec 28, 2022
Scene-Text-Detection-and-Recognition (Pytorch)

Scene-Text-Detection-and-Recognition (Pytorch) Competition URL: https://tbrain.t

Gi-Luen Huang 9 Jan 02, 2023
GraPE is a Rust/Python library for high-performance Graph Processing and Embedding.

GraPE GraPE (Graph Processing and Embedding) is a fast graph processing and embedding library, designed to scale with big graphs and to run on both of

AnacletoLab 194 Dec 29, 2022
Code for CVPR 2021 oral paper "Exploring Data-Efficient 3D Scene Understanding with Contrastive Scene Contexts"

Exploring Data-Efficient 3D Scene Understanding with Contrastive Scene Contexts The rapid progress in 3D scene understanding has come with growing dem

Facebook Research 182 Dec 30, 2022
CLUES: Few-Shot Learning Evaluation in Natural Language Understanding

CLUES: Few-Shot Learning Evaluation in Natural Language Understanding This repo contains the data and source code for baseline models in the NeurIPS 2

Microsoft 29 Dec 29, 2022
PyTorch implementation of "A Full-Band and Sub-Band Fusion Model for Real-Time Single-Channel Speech Enhancement."

FullSubNet This Git repository for the official PyTorch implementation of "A Full-Band and Sub-Band Fusion Model for Real-Time Single-Channel Speech E

郝翔 357 Jan 04, 2023
Unified Instance and Knowledge Alignment Pretraining for Aspect-based Sentiment Analysis

Unified Instance and Knowledge Alignment Pretraining for Aspect-based Sentiment Analysis Requirements python 3.7 pytorch-gpu 1.7 numpy 1.19.4 pytorch_

12 Oct 29, 2022
Synthetic Humans for Action Recognition, IJCV 2021

SURREACT: Synthetic Humans for Action Recognition from Unseen Viewpoints Gül Varol, Ivan Laptev and Cordelia Schmid, Andrew Zisserman, Synthetic Human

Gul Varol 59 Dec 14, 2022
Quickly comparing your image classification models with the state-of-the-art models (such as DenseNet, ResNet, ...)

Image Classification Project Killer in PyTorch This repo is designed for those who want to start their experiments two days before the deadline and ki

349 Dec 08, 2022
This implements the learning and inference/proposal algorithm described in "Learning to Propose Objects, Krähenbühl and Koltun"

Learning to propose objects This implements the learning and inference/proposal algorithm described in "Learning to Propose Objects, Krähenbühl and Ko

Philipp Krähenbühl 90 Sep 10, 2021
Self-Learning - Books Papers, Courses & more I have to learn soon

Self-Learning This repository is intended to be used for personal use, all rights reserved to respective owners, please cite original authors and ask

Achint Chaudhary 968 Jan 02, 2022
Offical implementation for "Trash or Treasure? An Interactive Dual-Stream Strategy for Single Image Reflection Separation".

Trash or Treasure? An Interactive Dual-Stream Strategy for Single Image Reflection Separation (NeurIPS 2021) by Qiming Hu, Xiaojie Guo. Dependencies P

Qiming Hu 31 Dec 20, 2022
BarcodeRattler - A Raspberry Pi Powered Barcode Reader to load a game on the Mister FPGA using MBC

Barcode Rattler A Raspberry Pi Powered Barcode Reader to load a game on the Mist

Chrissy 29 Oct 31, 2022
Evolution Strategies in PyTorch

Evolution Strategies This is a PyTorch implementation of Evolution Strategies. Requirements Python 3.5, PyTorch = 0.2.0, numpy, gym, universe, cv2 Wh

Andrew Gambardella 333 Nov 14, 2022