Assertion error when using histogram_freq>0 in TensorBoard callback
See original GitHub issueHey guys,
I’m trying to get Keras to work with TensorBoard, but when I set histogram_freq
to something different then 0
, I get the following AssertionError:
File "/home/projects/keras/keras/callbacks.py", line 925, in on_epoch_end
assert len(val_data) == len(tensors)
from here. The objects whose lengths are compared are created a few lines above like so:
val_data = self.validation_data
tensors = (self.model.inputs +
self.model.targets +
self.model.sample_weights)
Honestly, I don’t really see why this assertion makes sense, at least not with weights involved in the tensors. Might be obvious, but its my first time using Keras and I’m happy to learn.
The implementation can be found here. The version online works if you check it out, but changing histogram_freq
in this line makes the code crash after the first epoch.
I’m using the master branch, tested with the (currently) newest commit, but this error is present longer, at least since last weekend.
TensorFlow is version 1.11.0 from pip.
Also, as I’m new to Keras, general comments / advice about my code is very welcome.
Edit: #11044 seems to have the same problem.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:9 (2 by maintainers)
Bumping this to indicate continued interest. This is the fifth still-open, 9-month-old Keras bug I’ve encountered in the past two weeks.
It seems that the
tensors
list is full ofNone
entries in some cases (for me it was the Keras vanilla VAE example as well). However, removing allNone
entries before the assertion fixed the bug for me:Content of keras/callbacks.py: