我正在使用 Tensorflow 和 Tensorboard 1.14 版。
我想从使用 tf.summary.tensor_summary() 训练期间保存的数据开始执行一些离线分析。
我无法恢复使用所述方法保存的数据 here ,使用 tf.train.summary_iterator 可以恢复标量数据,但不能恢复我用 tensor_summary 方法保存的数据。
虽然与 EventAccumulator我能够恢复我保存的数据,它作为一个 TensorEvent 对象返回,它具有以下属性:
问题是我想将这些数据转换为 numpy 数组,TensorEvent 对象确实具有所需的所有信息(类型和形状的 tensor_proto,值的 tensor_content),但不是 Tensor 没有 .value 或 .numpy () 方法。 那么我是否将 TensorEvent 对象转换为一个 numpy 数组? 或者等价地放入一个 Tensor 对象然后放入一个 numpy 数组?
最佳答案
您可以使用 tf.make_ndarray
转换 TensorProto
成一个 NumPy 数组:
tensor_np = tf.make_ndarray(tensor_event.tensor_proto)
关于numpy - Tensorflow - Tensorboard Event Accumulator 从 TensorEvent 获取 Tensor,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59422920/