Reading tfevents into Unity

I’m trying to read out the training data as it appears in the TensorBoard in Unity (Environment/Cumulative Reward, Policy/Learning Rate, etc). I figured out it’s stored in the .tfevents file, which (correct me if I’m wrong) is encoded in the ProtoBuf format. I’m trying to read those Scalars into Unity after a RL training was concluded.

I know that the ML-Agents package already includes ProtoBuf, but I wouldn’t expect the .proto structure for the .fevents file to exist in Unity - so I guess I need to generate that to be able to Deserialize the fevents file. I looked into the protobuf-definitions/proto folder for a definition but I cannot find any that looks similar to how the file is stored.

This is where I’m stuck now. I’m not sure if this is the right path - and if so, I’m not sure how to deserialize the .fevents file so it can be read into Unity. I have no experience with ProtoBuf, so that also doesn’t help.

I found it’s a lot easier to read this from Python with the tensor package:

import tensorflow as tf

def main():
    for summary in tf.compat.v1.train.summary_iterator(path):
        print(summary)

if __name__ == '__main__':
    main()