У меня проблемы с чтением данных из модуля записи сводки тензорного потока.
Я использую писатель из примера на веб-сайте tenorflow: https://www.tensorflow.org/tensorboard/migrate
import tensorflow as tf
from tensorboard.backend.event_processing.event_accumulator import EventAccumulator
writer = tf.summary.create_file_writer("/tmp/mylogs/eager")
# write to summary writer
with writer.as_default():
for step in range(100):
# other model code would go here
tf.summary.scalar("my_metric", 0.5, step=step)
writer.flush()
# read from summary writer
event_acc = EventAccumulator("/tmp/mylogs/eager")
event_acc.Reload()
event_acc.Tags()
дает:
'distributions': [],
'graph': False,
'histograms': [],
'images': [],
'meta_graph': False,
'run_metadata': [],
'scalars': [],
'tensors': ['my_metric']}```
Если Я пытаюсь получить данные тензора:
import pandas as pd
pd.DataFrame(event_acc.Tensors('my_metric'))
Я не получаю правильных значений:
wall_time step tensor_proto
0 1.590743e+09 3 dtype: DT_FLOAT\ntensor_shape {\n}\ntensor_con...
1 1.590743e+09 20 dtype: DT_FLOAT\ntensor_shape {\n}\ntensor_con...
2 1.590743e+09 24 dtype: DT_FLOAT\ntensor_shape {\n}\ntensor_con...
3 1.590743e+09 32 dtype: DT_FLOAT\ntensor_shape {\n}\ntensor_con...
...
Как мне получить фактические сводные данные (которые должны быть 0,5, для каждый из 100 шагов)?
Вот блокнот colab с кодом выше: https://colab.research.google.com/drive/1RlgZrGD_vY-YcOBLF_sEPelmtVuygkqz?usp=sharing