I am trying to visualize weights of my Keras model with Tensorboard. Here is the model I am using:
model = Sequential([
Conv2D(filters=32, kernel_size=(3,3), padding="same", activation='relu', input_shape=(40,40,3)),
MaxPooling2D(pool_size=(2, 2)),
Conv2D(filters=64, kernel_size=(5,5), padding="same", activation='relu'),
MaxPooling2D(pool_size=(2, 2)),
Flatten(),
Dense(1024, activation='relu'),
Dropout(0.5),
Dense(43, activation='softmax'),
])
model.compile(optimizer='sgd',
loss='categorical_crossentropy',
metrics=['accuracy'])
and I am training with this call:
model.fit_generator(
...
callbacks = [
ModelCheckpoint('models/gtsrb1-{epoch}.hdf5', verbose=1, save_best_only = True),
TensorBoard(log_dir='tblogs/', write_graph=True, write_grads=True, write_images=True),
EarlyStopping(patience=5, verbose=1),
],)
However, when I start up TensorBoard, this is what I get:
Scalars and Graphs looks okay so it is not a problem of wrong logdir
. What am I doing wrong here?
You need to add histogram_freq=x
, where x
should be different than zero, so that the writing of images is enabled.
But if you do this, it might still fail, depending on the version of Keras (see https://github.com/fchollet/keras/issues/6096)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With