tensorflow / tensorflow/tensorboard

Tensorboard Graph Variables are Mislabeled

Open
#2,449 0 comments 0 reactions 1 assignee View on GitHub

@bileschi is already working on this.

Since Jul 22, 2019.

stat:awaiting tensorflower type:bug
Dominant language
TypeScript
Stars
7.2k
Forks
1.7k
Avg merge
4d 22h
Merged PRs (30d)
1

Description

Environment information (required)

Diagnostics
Diagnostics output
--- check: autoidentify
INFO: diagnose_tensorboard.py version 393931f9685bd7e0f3898d7dcdf28819fef54c43

--- check: general
INFO: sys.version_info: sys.version_info(major=3, minor=6, micro=4, releaselevel='final', serial=0)
INFO: os.name: posix
INFO: os.uname(): posix.uname_result(sysname='Darwin', nodename='brianpl-macbookpro.roam.corp.google.com', release='18.6.0', version='Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64', machine='x86_64')
INFO: sys.getwindowsversion(): N/A

--- check: package_management
INFO: has conda-meta: False
INFO: $VIRTUAL_ENV: None

--- check: installed_packages
INFO: installed: tb-nightly==1.14.0a20190603
INFO: installed: tensorflow==2.0.0b1
INFO: installed: tf-estimator-nightly==1.14.0.dev2019060501

--- check: tensorboard_python_version
INFO: tensorboard.version.VERSION: '1.14.0a20190603'

--- check: tensorflow_python_version
INFO: tensorflow.__version__: '2.0.0-beta1'
INFO: tensorflow.__git_version__: 'v2.0.0-beta0-16-g1d91213fe7'

--- check: tensorboard_binary_path
INFO: which tensorboard: b'/Library/Frameworks/Python.framework/Versions/3.6/bin/tensorboard\n'

--- check: readable_fqdn
INFO: socket.getfqdn(): 'brianpl-macbookpro.roam.corp.google.com'

--- check: stat_tensorboardinfo
INFO: directory: /var/folders/h8/fg3tr5r54xl7d2y5dyjm8nc000cxg4/T/.tensorboard-info
INFO: os.stat(...): os.stat_result(st_mode=16895, st_ino=8610964323, st_dev=16777220, st_nlink=3, st_uid=423396, st_gid=5000, st_size=96, st_atime=1563736522, st_mtime=1563735765, st_ctime=1563735765)
INFO: mode: 0o40777

--- check: source_trees_without_genfiles
INFO: tensorboard_roots (1): ['/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages']; bad_roots (0): []

--- check: full_pip_freeze
INFO: pip freeze --all:
absl-py==0.7.1
adal==1.2.2
appnope==0.1.0
asn1crypto==0.24.0
astor==0.8.0
attrs==19.1.0
azure==4.0.0
azure-applicationinsights==0.1.0
azure-batch==4.1.3
azure-cognitiveservices-nspkg==3.0.1
azure-cognitiveservices-search-customimagesearch==0.1.0
azure-cognitiveservices-search-imagesearch==1.0.0
azure-cognitiveservices-search-nspkg==3.0.1
azure-cognitiveservices-vision-customvision==1.0.0
azure-common==1.1.23
azure-cosmosdb-nspkg==2.0.2
azure-cosmosdb-table==1.0.5
azure-datalake-store==0.0.46
azure-eventgrid==1.3.0
azure-graphrbac==0.40.0
azure-keyvault==1.1.0
azure-loganalytics==0.1.0
azure-mgmt==4.0.0
azure-mgmt-advisor==1.0.1
azure-mgmt-applicationinsights==0.1.1
azure-mgmt-authorization==0.50.0
azure-mgmt-batch==5.0.1
azure-mgmt-batchai==2.0.0
azure-mgmt-billing==0.2.0
azure-mgmt-cdn==3.1.0
azure-mgmt-cognitiveservices==3.0.0
azure-mgmt-commerce==1.0.1
azure-mgmt-compute==4.6.2
azure-mgmt-consumption==2.0.0
azure-mgmt-containerinstance==1.5.0
azure-mgmt-containerregistry==2.8.0
azure-mgmt-containerservice==4.4.0
azure-mgmt-cosmosdb==0.4.1
azure-mgmt-datafactory==0.6.0
azure-mgmt-datalake-analytics==0.6.0
azure-mgmt-datalake-nspkg==3.0.1
azure-mgmt-datalake-store==0.5.0
azure-mgmt-datamigration==1.0.0
azure-mgmt-devspaces==0.1.0
azure-mgmt-devtestlabs==2.2.0
azure-mgmt-dns==2.1.0
azure-mgmt-eventgrid==1.0.0
azure-mgmt-eventhub==2.6.0
azure-mgmt-hanaonazure==0.1.1
azure-mgmt-iotcentral==0.1.0
azure-mgmt-iothub==0.5.0
azure-mgmt-iothubprovisioningservices==0.2.0
azure-mgmt-keyvault==1.1.0
azure-mgmt-loganalytics==0.2.0
azure-mgmt-logic==3.0.0
azure-mgmt-machinelearningcompute==0.4.1
azure-mgmt-managementgroups==0.1.0
azure-mgmt-managementpartner==0.1.1
azure-mgmt-maps==0.1.0
azure-mgmt-marketplaceordering==0.1.0
azure-mgmt-media==1.0.0
azure-mgmt-monitor==0.5.2
azure-mgmt-msi==0.2.0
azure-mgmt-network==2.7.0
azure-mgmt-notificationhubs==2.1.0
azure-mgmt-nspkg==3.0.2
azure-mgmt-policyinsights==0.1.0
azure-mgmt-powerbiembedded==2.0.0
azure-mgmt-rdbms==1.9.0
azure-mgmt-recoveryservices==0.3.0
azure-mgmt-recoveryservicesbackup==0.3.0
azure-mgmt-redis==5.0.0
azure-mgmt-relay==0.1.0
azure-mgmt-reservations==0.2.1
azure-mgmt-resource==2.2.0
azure-mgmt-scheduler==2.0.0
azure-mgmt-search==2.1.0
azure-mgmt-servicebus==0.5.3
azure-mgmt-servicefabric==0.2.0
azure-mgmt-signalr==0.1.1
azure-mgmt-sql==0.9.1
azure-mgmt-storage==2.0.0
azure-mgmt-subscription==0.2.0
azure-mgmt-trafficmanager==0.50.0
azure-mgmt-web==0.35.0
azure-nspkg==3.0.2
azure-servicebus==0.21.1
azure-servicefabric==6.3.0.0
azure-servicemanagement-legacy==0.20.6
azure-storage-blob==1.5.0
azure-storage-common==1.4.2
azure-storage-file==1.4.0
azure-storage-queue==1.4.0
backcall==0.1.0
beautifulsoup4==4.7.1
bleach==3.1.0
bs4==0.0.1
certifi==2019.6.16
cffi==1.12.3
chardet==3.0.4
Click==7.0
click-plugins==1.1.1
cligj==0.5.0
cryptography==2.7
cycler==0.10.0
decorator==4.4.0
defusedxml==0.6.0
descartes==1.1.0
entrypoints==0.3
Fiona==1.8.6
gast==0.2.2
geopandas==0.5.0
google-cloud==0.34.0
google-pasta==0.1.7
graphviz==0.11.1
grpcio==1.22.0
h5py==2.9.0
idna==2.8
imageio==2.5.0
ipykernel==5.1.1
ipython==7.6.1
ipython-genutils==0.2.0
ipywidgets==7.5.0
isodate==0.6.0
jedi==0.14.0
Jinja2==2.10.1
joblib==0.13.2
jsonschema==3.0.1
jupyter==1.0.0
jupyter-client==5.2.4
jupyter-console==6.0.0
jupyter-core==4.5.0
Keras==2.2.4
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.0
kiwisolver==1.1.0
Markdown==3.1.1
MarkupSafe==1.1.1
matplotlib==3.1.1
mistune==0.8.4
msrest==0.6.8
msrestazure==0.6.1
munch==2.3.2
nbconvert==5.5.0
nbformat==4.4.0
notebook==5.7.8
numpy==1.16.4
oauthlib==3.0.2
opencv-python==4.1.0.25
opt-einsum==2.3.2
pandas==0.24.2
pandocfilters==1.4.2
parso==0.5.0
pexpect==4.7.0
pickleshare==0.7.5
Pillow==6.1.0
pip==19.1.1
plotly==3.10.0
prometheus-client==0.7.1
prompt-toolkit==2.0.9
protobuf==3.8.0
ptyprocess==0.6.0
pycparser==2.19
Pygments==2.4.2
PyJWT==1.7.1
pyparsing==2.4.0
pyproj==2.2.1
pyrsistent==0.15.2
pyshp==2.1.0
python-dateutil==2.8.0
pytz==2019.1
PyYAML==5.1.1
pyzmq==18.0.2
qtconsole==4.5.1
requests==2.22.0
requests-oauthlib==1.2.0
retrying==1.3.3
scikit-learn==0.21.2
scipy==1.3.0
Send2Trash==1.5.0
setuptools==41.0.1
Shapely==1.6.4.post2
six==1.12.0
sklearn==0.0
soupsieve==1.9.2
tb-nightly==1.14.0a20190603
tensorflow==2.0.0b1
termcolor==1.1.0
terminado==0.8.2
testpath==0.4.2
tf-estimator-nightly==1.14.0.dev2019060501
tornado==6.0.3
traitlets==4.3.2
urllib3==1.25.3
wcwidth==0.1.7
webencodings==0.5.1
Werkzeug==0.15.4
wheel==0.33.4
widgetsnbextension==3.5.0
wrapt==1.11.2

Next steps

No action items identified. Please copy ALL of the above output,
including the lines containing only backticks, into your GitHub issue
or comment. Be sure to redact any sensitive information.

Issue description

I want to visualize a simple function using tensorboard, such as polar_to_cartesian (below). Following the instructions, I create my definition, decorated with @tensorflow.function, and then trace the function to a log directory, where it is detected by tensorboard.

In the resulting graph, the operators are correct, and the connections are correct, but the variables input are not. Where I should see r and theta and phi, I only see x.

Code
import tensorflow
import time

@tensorflow.function
def polar_to_cartesian(r, theta, phi):
    """Convert polar coordinates (r, theta, phi) to cartesian coordinates, (x, y, z)"""
    sin = tensorflow.math.sin
    cos = tensorflow.math.cos
    x = r * sin(theta) * cos(phi)
    y = r * sin(theta) * sin(phi)
    z = r * cos(theta)
    return (x, y, z)

# Trace polar_to_cartesian.
tensorboard_logdir = "./logs"

!mkdir -p {tensorboard_logdir}
!rm -r {tensorboard_logdir}/*

function_name = polar_to_cartesian.__name__

logdir = tensorboard_logdir + "/" + function_name

writer = tensorflow.summary.create_file_writer(logdir)

# Create some phony data to trace.
r, theta, phi = (1.0, 3.14, 1.57)

# Begin trace.
tensorflow.summary.trace_on(graph=True)

# Run the function
x, y, z = polar_to_cartesian(r, theta, phi)

# End trace and write summary.
with writer.as_default():
    tensorflow.summary.trace_export(
      name="polar_to_cartesian",
      step=0,
      profiler_outdir=logdir)
    
time.sleep(2)

%load_ext tensorboard
%tensorboard --logdir {tensorboard_logdir}
Result
Screen Shot 2019-07-21 at 3 16 33 PM

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.