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)
Offline Reinforcement Learning with Implicit Q-Learning

Offline Reinforcement Learning with Implicit Q-Learning This repository contains the official implementation of Offline Reinforcement Learning with Im

Ilya Kostrikov 126 Jan 06, 2023
A program that can analyze videos according to the weights you select

MaskMonitor A program that can analyze videos according to the weights you select 下載 訓練完的 weight檔案 執行 MaskDetection.py 內部可更改 輸入來源(鏡頭, 影片, 圖片) 以及輸出條件(人

Patrick_star 1 Nov 07, 2021
Converting CPT to bert form for use

cpt-encoder 将CPT转成bert形式使用 说明 刚刚刷到又出了一种模型:CPT,看论文显示,在很多中文任务上性能比mac bert还好,就迫不及待想把它用起来。 根据对源码的研究,发现该模型在做nlu建模时主要用的encoder部分,也就是bert,因此我将这部分权重转为bert权重类型

黄辉 1 Oct 14, 2021
YourTTS: Towards Zero-Shot Multi-Speaker TTS and Zero-Shot Voice Conversion for everyone

YourTTS: Towards Zero-Shot Multi-Speaker TTS and Zero-Shot Voice Conversion for everyone In our recent paper we propose the YourTTS model. YourTTS bri

Edresson Casanova 390 Dec 29, 2022
Implementation of Change-Based Exploration Transfer (C-BET)

Implementation of Change-Based Exploration Transfer (C-BET), as presented in Interesting Object, Curious Agent: Learning Task-Agnostic Exploration.

Simone Parisi 29 Dec 04, 2022
Experiments for Neural Flows paper

Neural Flows: Efficient Alternative to Neural ODEs [arxiv] TL;DR: We directly model the neural ODE solutions with neural flows, which is much faster a

54 Dec 07, 2022
Code for Massive-scale Decoding for Text Generation using Lattices

Massive-scale Decoding for Text Generation using Lattices Jiacheng Xu, Greg Durrett TL;DR: a new search algorithm to construct lattices encoding many

Jiacheng Xu 37 Dec 18, 2022
High accurate tool for automatic faces detection with landmarks

faces_detanator High accurate tool for automatic faces detection with landmarks. The library is based on public detectors with high accuracy (TinaFace

Ihar 7 May 10, 2022
Equivariant layers for RC-complement symmetry in DNA sequence data

Equi-RC Equivariant layers for RC-complement symmetry in DNA sequence data This is a repository that implements the layers as described in "Reverse-Co

7 May 19, 2022
A python implementation of Yolov5 to detect fire or smoke in the wild in Jetson Xavier nx and Jetson nano

yolov5-fire-smoke-detect-python A python implementation of Yolov5 to detect fire or smoke in the wild in Jetson Xavier nx and Jetson nano You can see

20 Dec 15, 2022
Create images and texts with the First Order Generative Adversarial Networks

First Order Divergence for training GANs This repository contains code accompanying the paper First Order Generative Advesarial Netoworks The majority

Zalando Research 35 Dec 11, 2021
Code for the paper: "On the Bottleneck of Graph Neural Networks and Its Practical Implications"

On the Bottleneck of Graph Neural Networks and its Practical Implications This is the official implementation of the paper: On the Bottleneck of Graph

75 Dec 22, 2022
Simulation-based performance analysis of server-less Blockchain-enabled Federated Learning

Blockchain-enabled Server-less Federated Learning Repository containing the files used to reproduce the results of the publication "Blockchain-enabled

Francesc Wilhelmi 9 Sep 27, 2022
Creating a Linear Program Solver by Implementing the Simplex Method in Python with NumPy

Creating a Linear Program Solver by Implementing the Simplex Method in Python with NumPy Simplex Algorithm is a popular algorithm for linear programmi

Reda BELHAJ 2 Oct 12, 2022
[SIGGRAPH 2021 Asia] DeepVecFont: Synthesizing High-quality Vector Fonts via Dual-modality Learning

DeepVecFont This is the official Pytorch implementation of the paper: Yizhi Wang and Zhouhui Lian. DeepVecFont: Synthesizing High-quality Vector Fonts

Yizhi Wang 146 Dec 18, 2022
Multiple types of NN model optimization environments. It is possible to directly access the host PC GUI and the camera to verify the operation. Intel iHD GPU (iGPU) support. NVIDIA GPU (dGPU) support.

mtomo Multiple types of NN model optimization environments. It is possible to directly access the host PC GUI and the camera to verify the operation.

Katsuya Hyodo 24 Mar 02, 2022
Source code for the paper "SEPP: Similarity Estimation of Predicted Probabilities for Defending and Detecting Adversarial Text" PACLIC 2021

Adversarial text generator Refer to "adversarial_text_generator"[https://github.com/quocnsh/SEPP_generator] project for generating adversarial texts A

0 Oct 05, 2021
MSG-Transformer: Exchanging Local Spatial Information by Manipulating Messenger Tokens

MSG-Transformer Official implementation of the paper MSG-Transformer: Exchanging Local Spatial Information by Manipulating Messenger Tokens, by Jiemin

Hust Visual Learning Team 68 Nov 16, 2022
[AAAI2021] The source code for our paper 《Enhancing Unsupervised Video Representation Learning by Decoupling the Scene and the Motion》.

DSM The source code for paper Enhancing Unsupervised Video Representation Learning by Decoupling the Scene and the Motion Project Website; Datasets li

Jinpeng Wang 114 Oct 16, 2022
GrailQA: Strongly Generalizable Question Answering

GrailQA is a new large-scale, high-quality KBQA dataset with 64,331 questions annotated with both answers and corresponding logical forms in different syntax (i.e., SPARQL, S-expression, etc.). It ca

OSU DKI Lab 76 Dec 21, 2022