Parsing `summary_str` byte string evaluated on tensorflow summary object

后端 未结 1 1063
野趣味
野趣味 2020-12-20 19:17

Currently tensorflow\'s tensorboard is not compatible with python3. Therefore and generally, I am looking for a way to print out the summary readouts once in 100 epochs.

相关标签:
1条回答
  • 2020-12-20 20:12

    You can get a textual representation of summary_str by parsing it into a tf.Summary protocol buffer as follows:

    summary_proto = tf.Summary()
    summary_proto.ParseFromString(summary_str)
    print(summary_proto)
    

    You can then convert it into a dictionary mapping string tags to floats:

    summaries = {}
    for val in summary_proto.value:
        # Assuming all summaries are scalars.
        summaries[val.tag] = val.simple_value
    
    0 讨论(0)
提交回复
热议问题