180207 Keras调用tensorboard
原创
©著作权归作者所有:来自51CTO博客作者GuokLiu的原创作品,请联系作者获取转载授权,否则将追究法律责任
How do I use the Tensorboard callback of Keras?
定义回调函数tensorboard
# callback tensorboard
tbCallBack = keras.callbacks.TensorBoard(log_dir='./Graph',
histogram_freq=1,
write_graph=True,
write_images=True)
在model.fit中使用
model_history = model.fit(X_train_train,
y_train_train,
batch_size=batch_size,
epochs=epochs,
verbose=1,
validation_data=(X_train_val, y_train_val),
callbacks = [EarlyStopping(patience=patience,mode='min',verbose=1),
history,
tbCallBack])
在命令行窗口调用
tensorboard --logdir path_to_current_dir/Graph
打开浏览器输入相应地址