📜  如何使用张量板 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:12.331000             🧑  作者: Mango

代码示例1
import datetime
from tensorflow.keras.callbacks import TensorBoard

# Set Folder for saving logs
logDir = "logs/13-500Feature/" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S") #If you are using linux
print("logDir: ", logDir)

# Train your model
model.fit(x_train, y_train, batch_size=32, epochs=100,
         validation_data=(x_test, y_test),
         verbose=1,
         callbacks = [tensorboard_callback])   # Use Checkpoint callback
                                                    
# Use In jupyter notebook or Google Colab

%load_ext tensorboard
%tensorboard --logdir logs