且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何从 tensorflow 2 摘要编写器读取数据

更新时间:2023-12-02 18:41:46

需要在事件累加器中转换张量值,存储为 TensorProto 消息,放入数组中,您可以使用 tf.make_ndarray:

You need to convert the tensor values in the event accumulator, stored as TensorProto messages, into arrays, which you can do with tf.make_ndarray:

pd.DataFrame([(w, s, tf.make_ndarray(t)) for w, s, t in event_acc.Tensors('my_metric')],
             columns=['wall_time', 'step', 'tensor'])