Tensorboard用作callback时,
from keras.callbacks import TensorBoard
tb = TensorBoard(log_dir=clog_dir)
默认创建plugins/profile目录
不需要该目录时可以设置profile_batch=0关闭
from keras.callbacks import TensorBoard
tb = TensorBoard(log_dir=clog_dir, profile_batch=0)
参考:
TensorBoard(
log_dir="logs",
histogram_freq=0,
write_graph=True,
write_images=False,
update_freq="epoch",
profile_batch=2,
embeddings_freq=0,
embeddings_metadata=None,
**kwargs
)
- log_dir – the path to the directory where we are going to store our logs.
- histogram_freq – this represents the frequency at which to calculate weight histograms and compute activation for each layer in the model. The default value is set to 0. If it isn’t set or it’s set to 0, the histogram won’t be computed. Validation data must be specified for histogram visualizations.
- write_graph – Whether to visualize the graph in Tensorboard. If set to True, it can make a log file large.
- write_images – Boolean, whether to visualize model weights as images in Tensorboard. The default value is False.
- update_freq – Default value is epoch, this parameter expects a batch, epoch or an integer. If a batch is supplied it means that losses and metrics will be written by a callback to Tensorboard after every batch or if epoch is supplied it’s going to write after every epoch. Otherwise, if an integer is supplied, let’s say 50, it means that losses and metrics will be written after every 50 batches.
- profile_batch – It sets the batch or batches to be profiled, the default value is 2, meaning the second batch will be profiled. To disable profiling, set the value to zero, profile_batch can only be a positive integer or a range let’s say (2,6) this will profile batches from 2 to 6.
- embeddings_freq – Default value is 0, this represents the frequency of visualizing embedding layers.
- embeddings_metadata – A dictionary that maps a layer to a file in which metadata for this embedding layer is saved, default value is None.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)