【问题标题】:How to access log file with tensorboard on anaconda如何在 anaconda 上使用 tensorboard 访问日志文件
【发布时间】:2019-08-31 00:52:19
【问题描述】:

我在 Ananconda 环境中使用 Keras 制作了一个 NN 模型(我使用的是 Jupiter)。 我想访问我正在用 tensorboard 编写的日志文件,我想查看准确度和损失函数图。

但是,当我尝试从终端访问日志文件时,会出现此错误:AttributeError: module 'tensorboard.util' has no attribute 'PersistentOpEvaluator'

任何人都可以帮我写这些图并看到它们打开张量板吗?

这是我的代码:

    hidden_size = 256

    sl_model = keras.models.Sequential()
    [...]
    sl_model.add(keras.layers.Dense(max_length, activation='softmax')) 
    optimizer = keras.optimizers.Adam()
    sl_model.compile(loss='binary_crossentropy', optimizer=optimizer, metrics=['acc'])

    batch_size = 128
    epochs = 3

    # Let's print a summary of the model
    sl_model.summary()

    #I'd like to access to this file
    cbk = keras.callbacks.TensorBoard("logging/keras_model")

    print("\nStarting training...")
    sl_model.fit(x_train, y_train, epochs=epochs, batch_size=batch_size,
      shuffle=True, validation_data=(x_dev, y_dev), callbacks=[cbk])

我该如何解决这个问题?谢谢!

【问题讨论】:

  • 你使用什么 tensorflow 版本?您可以在 tensorflow 2.0 中从 jupyter 访问 tensorboard。
  • 我使用的是 1.12 版
  • 您使用的是独立的keras 还是tf.keras
  • 我正在使用 tensorflow.keras 作为 keras
  • 你有多个 anaconda 环境吗?或者你也安装了 pip tensorflow?

标签: python tensorflow anaconda tensorboard


【解决方案1】:

如果您的tensorflow 版本是最新的,您必须删除站点包中的tensorboard 目录然后pip install tensorboard --upgrade

【讨论】:

  • 要求我使用tensorflow 1.12版本...所以我无法升级它
  • 你试过只升级 tensorboard 吗?
猜你喜欢
  • 2012-06-15
  • 2013-05-19
  • 2013-04-26
  • 2014-08-25
  • 1970-01-01
  • 2021-12-12
  • 1970-01-01
  • 1970-01-01
  • 2012-08-16
相关资源
最近更新 更多