[英]Unable to write data to TensorBoard
我曾經成功使用過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,遇到了“當前數據集沒有儀表板處於活動狀態”的消息。 我相當確定錯誤出在我的代碼中,但是我過去已經能夠運行此代碼,並且不確定錯誤可能在哪里。
您的--logdir
參數--logdir
錯誤,請勿使用等號:
tensorboard --logdir C:\Users\Jack\Documents\GaTech\Research\Code\TensorFlow\logs
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.