我正在使用Tensorflow和Tensorboard版本1.14。我想从我在训练期间使用tf.summary.tensor_summary()
保存的数据开始进行一些离线分析我无法使用tf.train.summary_iterator恢复使用here描述的方法保存的数据,它确实恢复了标量数据,但不恢复我使用tensor_summary方法保存的数据。
尽管通过EventAccumulator对象,我能够恢复保存的数据,但它作为具有以下属性的TensorEvent对象返回:
就是我想将此数据转换为numpy数组,TensorEvent对象肯定具有所需的所有信息(用于类型和形状的tensor_proto,用于值的tensor_content),但不是Tensor则不具有.value或a .numpy()方法。 所以我将TensorEvent对象转换为numpy数组?或等效地转换为Tensor对象,然后转换为numpy数组?
您可以使用tf.make_ndarray
将tf.make_ndarray
转换为NumPy数组:
TensorProto