【问题标题】:Unable to write data to TensorBoard无法将数据写入 TensorBoard
【发布时间】: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


    【解决方案1】:

    你有一个格式错误的--logdir 参数,不要使用等号:

    tensorboard --logdir C:\Users\Jack\Documents\GaTech\Research\Code\TensorFlow\logs
    

    【讨论】:

      猜你喜欢
      • 2022-10-12
      • 2022-11-22
      • 1970-01-01
      • 2015-04-07
      • 2017-06-05
      • 1970-01-01
      • 2018-05-08
      • 2021-04-15
      • 1970-01-01
      相关资源
      最近更新 更多