Returns a dict of all runs and their data availabilities.
(self, ctx, experiment=None)
| 75 | ) |
| 76 | |
| 77 | def info_impl(self, ctx, experiment=None): |
| 78 | """Returns a dict of all runs and their data availabilities.""" |
| 79 | result = {} |
| 80 | |
| 81 | def add_row_item(run, tag=None): |
| 82 | run_item = result.setdefault( |
| 83 | run, |
| 84 | { |
| 85 | "run": run, |
| 86 | "tags": {}, |
| 87 | # A run-wide GraphDef of ops. |
| 88 | "run_graph": False, |
| 89 | }, |
| 90 | ) |
| 91 | |
| 92 | tag_item = None |
| 93 | if tag: |
| 94 | tag_item = run_item.get("tags").setdefault( |
| 95 | tag, |
| 96 | { |
| 97 | "tag": tag, |
| 98 | "conceptual_graph": False, |
| 99 | # A tagged GraphDef of ops. |
| 100 | "op_graph": False, |
| 101 | "profile": False, |
| 102 | }, |
| 103 | ) |
| 104 | return (run_item, tag_item) |
| 105 | |
| 106 | mapping = self._data_provider.list_blob_sequences( |
| 107 | ctx, |
| 108 | experiment_id=experiment, |
| 109 | plugin_name=metadata.PLUGIN_NAME_RUN_METADATA_WITH_GRAPH, |
| 110 | ) |
| 111 | for run_name, tags in mapping.items(): |
| 112 | for tag, tag_data in tags.items(): |
| 113 | # The Summary op is defined in TensorFlow and does not use a stringified proto |
| 114 | # as a content of plugin data. It contains single string that denotes a version. |
| 115 | # https://github.com/tensorflow/tensorflow/blob/11f4ecb54708865ec757ca64e4805957b05d7570/tensorflow/python/ops/summary_ops_v2.py#L789-L790 |
| 116 | if tag_data.plugin_content != b"1": |
| 117 | logger.warning( |
| 118 | "Ignoring unrecognizable version of RunMetadata." |
| 119 | ) |
| 120 | continue |
| 121 | (_, tag_item) = add_row_item(run_name, tag) |
| 122 | tag_item["op_graph"] = True |
| 123 | |
| 124 | # Tensors associated with plugin name metadata.PLUGIN_NAME_RUN_METADATA |
| 125 | # contain both op graph and profile information. |
| 126 | mapping = self._data_provider.list_blob_sequences( |
| 127 | ctx, |
| 128 | experiment_id=experiment, |
| 129 | plugin_name=metadata.PLUGIN_NAME_RUN_METADATA, |
| 130 | ) |
| 131 | for run_name, tags in mapping.items(): |
| 132 | for tag, tag_data in tags.items(): |
| 133 | if tag_data.plugin_content != b"1": |
| 134 | logger.warning( |