question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TensorBoard Keras Callback fails, if input type is tf.string

See original GitHub issue

TensorBoard Version: 1.9.0 TensorFlow Version: 1.9.0 OS: macOS 10.13.6 Python Version: 2.7.10 / 3.6.4

Hi,

TensorBoard exists with the following error, if one of the input layers has the input dtype=tf.string:

  File "train.py", line 236, in train
    validation_data=(X_val, y_val), callbacks=[early_stop, checkpoints, tensor_board])
  File "~/venv/lib/python3.6/site-packages/keras/engine/training.py", line 1705, in fit
    validation_steps=validation_steps)
  File "~/venv/lib/python3.6/site-packages/keras/engine/training.py", line 1155, in _fit_loop
    callbacks.set_model(callback_model)
  File "~/venv/lib/python3.6/site-packages/keras/callbacks.py", line 52, in set_model
    callback.set_model(model)
  File "~/venv/lib/python3.6/site-packages/keras/callbacks.py", line 782, in set_model
    layer.output)
  File "~/venv/lib/python3.6/site-packages/tensorflow/python/summary/summary.py", line 203, in histogram
    tag=tag, values=values, name=scope)
  File "~/venv/lib/python3.6/site-packages/tensorflow/python/ops/gen_logging_ops.py", line 283, in histogram_summary
    "HistogramSummary", tag=tag, values=values, name=name)
  File "~/venv/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 609, in _apply_op_helper
    param_name=input_name)
  File "~/venv/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 60, in _SatisfiesTypeConstraint
    ", ".join(dtypes.as_dtype(x).name for x in allowed_list)))
TypeError: Value passed to parameter 'values' has DataType string not in list of allowed values: float32, float64, int32, uint8, int16, int8, int64, bfloat16, uint16, float16, uint32, uint64

If I change the input of the layer to int32 TensorBoard works fine (nothing is added though), however as expected the training fails. The layer is just a simple Input layer: Input(shape=(None,), dtype=tf.string).

Best, Timon

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
peteboothroydcommented, Aug 1, 2019

is there any update on this?

0reactions
omalleyt12commented, Sep 9, 2019

Could you try with the latest 2.0 nightly? I am not seeing this issue there

Read more comments on GitHub >

github_iconTop Results From Across the Web

tf.keras.callbacks.TensorBoard | TensorFlow v2.11.0
TensorBoard is a visualization tool provided with TensorFlow. This callback logs events for TensorBoard, including: Metrics summary plots; Training graph ...
Read more >
How do I use the Tensorboard callback of Keras?
This line creates a Callback Tensorboard object, you should capture that object and give it to the fit function of your model. tbCallBack...
Read more >
Introduction to Keras for Engineers
Keras models accept three types of inputs: NumPy arrays, just like Scikit-Learn and many other Python-based libraries. This is a good option if...
Read more >
Release 2.7.0
The API endpoints for tf.keras stay unchanged, but are now backed by the keras PIP package. The existing code in tensorflow/python/keras is a...
Read more >
The complete guide to ML model visualization with Tensorboard
The purpose of adding a datetime string to the directory is to ensure that ... This tutorial will focus on using callbacks to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found