Get raw data (steps and values) from tensorboard events. Args: log_path (str): Path to the tensorboard log. tag (str): tag to be read.
(log_path, tag)
| 2 | |
| 3 | |
| 4 | def read_data_from_tensorboard(log_path, tag): |
| 5 | """Get raw data (steps and values) from tensorboard events. |
| 6 | |
| 7 | Args: |
| 8 | log_path (str): Path to the tensorboard log. |
| 9 | tag (str): tag to be read. |
| 10 | """ |
| 11 | from tensorboard.backend.event_processing.event_accumulator import EventAccumulator |
| 12 | |
| 13 | # tensorboard event |
| 14 | event_acc = EventAccumulator(log_path) |
| 15 | event_acc.Reload() |
| 16 | scalar_list = event_acc.Tags()['scalars'] |
| 17 | print('tag list: ', scalar_list) |
| 18 | steps = [int(s.step) for s in event_acc.Scalars(tag)] |
| 19 | values = [s.value for s in event_acc.Scalars(tag)] |
| 20 | return steps, values |
| 21 | |
| 22 | |
| 23 | def read_data_from_txt_2v(path, pattern, step_one=False): |
nothing calls this directly
no outgoing calls
no test coverage detected