Tensorboard: Eager execution with TensorBoard Beholder

Created on 8 Dec 2019  路  6Comments  路  Source: tensorflow/tensorboard

Environment information

Diagnostics


Diagnostics output

``````
--- check: autoidentify
INFO: diagnose_tensorboard.py version 4757bed82ecd75d96baf8210f75638afd2e07c63

--- check: general
INFO: sys.version_info: sys.version_info(major=3, minor=6, micro=8, releaselevel='final', serial=0)
INFO: os.name: posix
INFO: os.uname(): posix.uname_result(sysname='Darwin', nodename='SumanthRatnasAir', release='19.2.0', version='Darwin Kernel Version 19.2.0: Wed Nov 13 22:22:44 PST 2019; root:xnu-6153.61.1~26/RELEASE_X86_64', machine='x86_64')
INFO: sys.getwindowsversion(): N/A

--- check: package_management
INFO: has conda-meta: False
INFO: $VIRTUAL_ENV: '/Users/suman/.local/share/virtualenvs/mlencrypt-research-PwGoqeJm'

--- check: installed_packages
INFO: installed: tensorboard==2.0.2
INFO: installed: tensorflow==2.0.0
INFO: installed: tensorflow-estimator==2.0.1

--- check: tensorboard_python_version
INFO: tensorboard.version.VERSION: '2.0.2'

--- check: tensorflow_python_version
INFO: tensorflow.__version__: '2.0.0'
INFO: tensorflow.__git_version__: 'v2.0.0-rc2-26-g64c3d382ca'

--- check: tensorboard_binary_path
INFO: which tensorboard: b'/Users/suman/.local/share/virtualenvs/mlencrypt-research-PwGoqeJm/bin/tensorboard\n'

--- check: addrinfos
socket.has_ipv6 = True
socket.AF_UNSPEC =
socket.SOCK_STREAM =
socket.AI_ADDRCONFIG =
socket.AI_PASSIVE =
Loopback flags:
Loopback infos: [(, , 6, '', ('::1', 0, 0, 0)), (, , 6, '', ('127.0.0.1', 0))]
Wildcard flags:
Wildcard infos: [(, , 6, '', ('::', 0, 0, 0)), (, , 6, '', ('0.0.0.0', 0))]

--- check: readable_fqdn
INFO: socket.getfqdn(): 'SumanthRatnasAir'

--- check: stat_tensorboardinfo
INFO: directory: /var/folders/j8/_wc022w91rvctlq5_t8xqcvc0000gn/T/.tensorboard-info
INFO: os.stat(...): os.stat_result(st_mode=16895, st_ino=63401941, st_dev=16777220, st_nlink=2, st_uid=501, st_gid=20, st_size=64, st_atime=1575740073, st_mtime=1575759927, st_ctime=1575759927)
INFO: mode: 0o40777

--- check: source_trees_without_genfiles
INFO: tensorboard_roots (1): ['/Users/suman/.local/share/virtualenvs/mlencrypt-research-PwGoqeJm/lib/python3.6/site-packages']; bad_roots (0): []

--- check: full_pip_freeze
INFO: pip freeze --all:
absl-py==0.8.1
astor==0.8.0
cachetools==3.1.1
certifi==2019.11.28
cffi==1.13.2
chardet==3.0.4
Click==7.0
cryptography==2.8
cycler==0.10.0
gast==0.2.2
google-auth==1.7.2
google-auth-oauthlib==0.4.1
google-pasta==0.1.8
grpcio==1.25.0
h5py==2.10.0
idna==2.8
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.0
kiwisolver==1.1.0
Markdown==3.1.1
matplotlib==3.1.2
mlencrypt==0.1
numpy==1.17.4
oauthlib==3.1.0
opt-einsum==3.1.0
pandas==0.25.3
pip==19.3.1
protobuf==3.11.1
pyAesCrypt==0.4.3
pyasn1==0.4.8
pyasn1-modules==0.2.7
pycparser==2.19
pydicom==1.3.0
pyparsing==2.4.5
python-dateutil==2.8.1
pytz==2019.3
requests==2.22.0
requests-oauthlib==1.3.0
rsa==4.0
scipy==1.3.3
seaborn==0.9.0
setuptools==42.0.1
six==1.13.0
tensorboard==2.0.2
tensorflow==2.0.0
tensorflow-estimator==2.0.1
termcolor==1.1.0
urllib3==1.25.7
Werkzeug==0.16.0
wheel==0.33.6
wrapt==1.11.2

``````

Next steps

No action items identified.

Issue description

Using TensorFlow 2.0 and Eager Execution, I'm unable to set up Beholder.

Here's the error output:

Traceback (most recent call last):
  File "mlencrypt.py", line 12, in <module>
    beholder = Beholder(logdir)
  File ".../lib/python3.6/site-packages/tensorboard/plugins/beholder/beholder.py", line 50, in __init__
    self.frame_placeholder = tf.compat.v1.placeholder(tf.uint8, [None, None, None])
  File ".../lib/python3.6/site-packages/tensorflow_core/python/ops/array_ops.py", line 2627, in placeholder
    raise RuntimeError("tf.placeholder() is not compatible with "
RuntimeError: tf.placeholder() is not compatible with eager execution.

Right before it, I run tf.config.experimental_run_functions_eagerly(True) but if I comment out this line, I still get the same error.

beholder contributions welcome feature

Most helpful comment

Not exactly related to this issue, but are there any plans to make Beholder work with autograph in TensorFlow 2?

All 6 comments

In order to expedite the trouble-shooting process, please provide a code snippet to reproduce the issue reported here. Thanks!

from os import path
import tensorflow as tf
from tensorboard.plugins.hparams import api as hp
from tensorboard.plugins.beholder import Beholder

tf.config.experimental_run_functions_eagerly(True)
logdir = 'logs/' + str(datetime.now())
makedirs(path.join(logdir, 'plugins/beholder'))
beholder = Beholder(logdir)

def run():
    # variables
    while score < 100:
        # update
        beholder.update()

def main():
    use_hparams = True
    input_file = 'test.dcm'  # or test.txt
    output_file = 'out.enc'

    if use_hparams:
        logdir = 'logs/hparams/' + str(datetime.now())
        # hparams code
        run()
    else:
        # normal run
        run()

if __name__ == "__main__":
    main()

TensorBoard 2.0 does not officially support beholder.

It was written for the graph mode in v1 and it was not modified to work with the eager mode. We'd welcome any contributions to enable it!

Not exactly related to this issue, but are there any plans to make Beholder work with autograph in TensorFlow 2?

Duplicate of #1237

Was this page helpful?
0 / 5 - 0 ratings