【发布时间】:2018-05-29 18:07:21
【问题描述】:
我曾经成功使用过一次 TensorBoard,但从那以后我就无法录制任何东西。
我有以下代码
def compile_and_train(model):
model.compile(loss='categorical_crossentropy', optimizer=Adam(), metrics=['acc'])
filepath = 'weights/' + model.name + '.{epoch:02d}-{loss:.2f}.hdf5'
checkpoint = ModelCheckpoint(filepath, monitor='loss', verbose=0, save_weights_only=True, save_best_only=True, mode='auto', period=1)
current_directory = 'C:/Users/Jack/Documents/GaTech/Research/Code/TensorFlow/logs'
tensor_board = TensorBoard(log_dir = current_directory, histogram_freq=1, batch_size=32)
history = model.fit(x=data.train.images, y=data.train.labels,
batch_size=128, epochs = 1, verbose=1,
callbacks=[checkpoint, tensor_board], validation_split=0.2)
return history
我跑完之后:
Model_1 = create_model()
history = compile_and_train(Model_1)
和
tensorboard --logdir = C:\Users\Jack\Documents\GaTech\Research\Code\TensorFlow\logs
(没有任何错误)- 然后我去了 TensorBoard,遇到了一个 “当前数据集没有处于活动状态的仪表板”消息。 我相当确定错误在我的代码中,但我过去能够运行此代码,但不确定错误可能出在哪里。
【问题讨论】:
标签: python tensorflow tensorboard