Can I use TensorBoard with Google Colab?

前端 未结 19 3047
滥情空心
滥情空心 2020-11-27 10:43

Is there any way to use TensorBoard when training a TensorFlow model on Google Colab?

19条回答
  •  广开言路
    2020-11-27 11:10

    According to the documentation all you need to do is this:

    %load_ext tensorboard
    !rm -rf ./logs/ #to delete previous runs
    %tensorboard --logdir logs/
    tensorboard = TensorBoard(log_dir="./logs")
    

    And just call it in the fit method:

    model.fit(X_train, y_train, epochs = 1000,
             callbacks=[tensorboard], validation_data=(X_test, y_test))
    

    And that should give you something like this:

    I can't post a picture yet so use the link.

提交回复
热议问题