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)
MVSDF - Learning Signed Distance Field for Multi-view Surface Reconstruction

MVSDF - Learning Signed Distance Field for Multi-view Surface Reconstruction This is the official implementation for the ICCV 2021 paper Learning Sign

110 Dec 20, 2022
Implementation of C-RNN-GAN.

Implementation of C-RNN-GAN. Publication: Title: C-RNN-GAN: Continuous recurrent neural networks with adversarial training Information: http://mogren.

Olof Mogren 427 Dec 25, 2022
(CVPR 2022) A minimalistic mapless end-to-end stack for joint perception, prediction, planning and control for self driving.

LAV Learning from All Vehicles Dian Chen, Philipp Krähenbühl CVPR 2022 (also arXiV 2203.11934) This repo contains code for paper Learning from all veh

Dian Chen 300 Dec 15, 2022
(CVPR 2021) Back-tracing Representative Points for Voting-based 3D Object Detection in Point Clouds

BRNet Introduction This is a release of the code of our paper Back-tracing Representative Points for Voting-based 3D Object Detection in Point Clouds,

86 Oct 05, 2022
A lossless neural compression framework built on top of JAX.

Kompressor Branch CI Coverage main (active) main development A neural compression framework built on top of JAX. Install setup.py assumes a compatible

Rosalind Franklin Institute 2 Mar 14, 2022
Code for "OctField: Hierarchical Implicit Functions for 3D Modeling (NeurIPS 2021)"

OctField(Jittor): Hierarchical Implicit Functions for 3D Modeling Introduction This repository is code release for OctField: Hierarchical Implicit Fun

55 Dec 08, 2022
Publication describing 3 ML examples at NSLS-II and interfacing into Bluesky

Machine learning enabling high-throughput and remote operations at large-scale user facilities. Overview This repository contains the source code and

BNL 4 Sep 24, 2022
OverFeat is a Convolutional Network-based image classifier and feature extractor.

OverFeat OverFeat is a Convolutional Network-based image classifier and feature extractor. OverFeat was trained on the ImageNet dataset and participat

593 Dec 08, 2022
A project to build an AI voice assistant using Python . The Voice assistant interacts with the humans to perform basic tasks.

AI_Personal_Voice_Assistant_Using_Python A project to build an AI voice assistant using Python . The Voice assistant interacts with the humans to perf

Chumui Tripura 1 Oct 30, 2021
Algorithmic Trading using RNN

Deep-Trading This an implementation adapted from Rachnog Neural networks for algorithmic trading. Part One — Simple time series forecasting and this c

Hazem Nomer 29 Sep 04, 2022
[ WSDM '22 ] On Sampling Collaborative Filtering Datasets

On Sampling Collaborative Filtering Datasets This repository contains the implementation of many popular sampling strategies, along with various expli

Noveen Sachdeva 17 Dec 08, 2022
Segment axon and myelin from microscopy data using deep learning

Segment axon and myelin from microscopy data using deep learning. Written in Python. Using the TensorFlow framework. Based on a convolutional neural network architecture. Pixels are classified as eit

NeuroPoly 103 Nov 29, 2022
Soomvaar is the repo which 🏩 contains different collection of 👨‍💻🚀code in Python and 💫✨Machine 👬🏼 learning algorithms📗📕 that is made during 📃 my practice and learning of ML and Python✨💥

Soomvaar 📌 Introduction Soomvaar is the collection of various codes implement in machine learning and machine learning algorithms with python on coll

Felix-Ayush 42 Dec 30, 2022
PyTorch implementation of paper A Fast Knowledge Distillation Framework for Visual Recognition.

FKD: A Fast Knowledge Distillation Framework for Visual Recognition Official PyTorch implementation of paper A Fast Knowledge Distillation Framework f

Zhiqiang Shen 129 Dec 24, 2022
CDTrans: Cross-domain Transformer for Unsupervised Domain Adaptation

[ICCV2021] TransReID: Transformer-based Object Re-Identification [pdf] The official repository for TransReID: Transformer-based Object Re-Identificati

DamoCV 569 Dec 30, 2022
[WACV 2022] Contextual Gradient Scaling for Few-Shot Learning

CxGrad - Official PyTorch Implementation Contextual Gradient Scaling for Few-Shot Learning Sanghyuk Lee, Seunghyun Lee, and Byung Cheol Song In WACV 2

Sanghyuk Lee 4 Dec 05, 2022
Garbage classification using structure data.

垃圾分类模型使用说明 1.包含以下数据文件 文件 描述 data/MaterialMapping.csv 物体以及其归类的信息 data/TestRecords 光谱原始测试数据 CSV 文件 data/TestRecordDesc.zip CSV 文件描述文件 data/Boundaries.cs

wenqi 1 Dec 10, 2021
Implementation of Kaneko et al.'s MaskCycleGAN-VC model for non-parallel voice conversion.

MaskCycleGAN-VC Unofficial PyTorch implementation of Kaneko et al.'s MaskCycleGAN-VC (2021) for non-parallel voice conversion. MaskCycleGAN-VC is the

86 Dec 25, 2022
MACE is a deep learning inference framework optimized for mobile heterogeneous computing platforms.

Documentation | FAQ | Release Notes | Roadmap | MACE Model Zoo | Demo | Join Us | 中文 Mobile AI Compute Engine (or MACE for short) is a deep learning i

Xiaomi 4.7k Dec 29, 2022
Anomaly detection analysis and labeling tool, specifically for multiple time series (one time series per category)

taganomaly Anomaly detection labeling tool, specifically for multiple time series (one time series per category). Taganomaly is a tool for creating la

Microsoft 272 Dec 17, 2022