'TensorBoard' object has no attribute 'sess'
See original GitHub issueSystem information
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Mac Os
- Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
- TensorFlow installed from (source or binary):binary
- TensorFlow version (use command below):1.12
- Tensorboard: 1.12
- Python version:3.6
- Bazel version (if compiling from source):
- GCC/Compiler version (if compiling from source):
- CUDA/cuDNN version:N/A
- GPU model and memory:N/A
You can collect some of this information using our environment capture script You can also obtain the TensorFlow version with python -c “import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)” v1.12.0-rc2-3-ga6d8ffae09 1.12.0 Describe the current behavior I want to use the tensorboard callback in keras to show the embeddings in the projector view Describe the expected behavior I’m getting an error while training. Code to reproduce the issue Provide a reproducible test case that is the bare minimum necessary to generate the problem.
tensorboard = keras.callbacks.TensorBoard(
log_dir='./logs',
batch_size=128,
histogram_freq=1,
embeddings_freq=1,
embeddings_metadata='./metadata.tsv',
embeddings_data=X_Test
)
history = model.fit(ready_data, ready_labels, batch_size=128, epochs=20,validation_data=(X_Test,Y_test),callbacks=[tensorboard])
Other info / logs Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.
Traceback (most recent call last):
File "/Users/alcaljos/Projects/issue-classifer-ml/src/main.py", line 193, in <module>
history = model.fit(ready_data, ready_labels, batch_size=128, epochs=20,validation_data=(X_Test,Y_test),callbacks=[tensorboard,checkpointer])
File "/Users/alcaljos/anaconda/envs/issue-classifier/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py", line 1639, in fit
validation_steps=validation_steps)
File "/Users/alcaljos/anaconda/envs/issue-classifier/lib/python3.6/site-packages/tensorflow/python/keras/engine/training_arrays.py", line 239, in fit_loop
callbacks.on_epoch_end(epoch, epoch_logs)
File "/Users/alcaljos/anaconda/envs/issue-classifier/lib/python3.6/site-packages/tensorflow/python/keras/callbacks.py", line 214, in on_epoch_end
callback.on_epoch_end(epoch, logs)
File "/Users/alcaljos/anaconda/envs/issue-classifier/lib/python3.6/site-packages/tensorflow/python/keras/callbacks.py", line 1144, in on_epoch_end
self.sess.run(self.assign_embeddings, feed_dict=feed_dict)
AttributeError: 'TensorBoard' object has no attribute 'sess'
Issue Analytics
- State:
- Created 5 years ago
- Comments:8
Top GitHub Comments
Fixed by https://github.com/tensorflow/tensorflow/commit/d994300bde00c7dee8bacccdbc5d67c3f3f2b322
This fix should be available in the upcoming 1.14 release of TensorFlow, or you can check out the nightly release
tf-nightly
, which should already have it.As a temporary workaround, just overwrite the existing
TensorBoard
with a new one, that has a session:Then, just continue using
TensorBoard
normally.