Back to Tensorflow

tflite_support.metadata.convert_to_json

tensorflow/lite/g3doc/api_docs/python/tflite_support/metadata/convert_to_json.md

2.21.01.9 KB
Original Source

page_type: reference description: Converts the metadata into a json string.

<link rel="stylesheet" href="/site-assets/css/style.css"> <!-- DO NOT EDIT! Automatically generated file. --> <div itemscope itemtype="http://developers.google.com/ReferenceObject"> <meta itemprop="name" content="tflite_support.metadata.convert_to_json" /> <meta itemprop="path" content="Stable" /> </div>

tflite_support.metadata.convert_to_json

<!-- Insert buttons and diff --> <table class="tfo-notebook-buttons tfo-api nocontent" align="left"> <td> <a target="_blank" href="https://github.com/tensorflow/tflite-support/blob/v0.4.4/tensorflow_lite_support/metadata/python/metadata.py#L794-L814">
View source on GitHub
</a> </td> </table>

Converts the metadata into a json string.

<pre class="devsite-click-to-copy prettyprint lang-py tfo-signature-link"> <code>tflite_support.metadata.convert_to_json( metadata_buffer ) </code></pre> <!-- Placeholder for "Used in" --> <!-- Tabular view --> <table class="responsive fixed orange"> <colgroup><col width="214px"><col></colgroup> <tr><th colspan="2"><h2 class="add-link">Args</h2></th></tr> <tr> <td> `metadata_buffer`<a id="metadata_buffer"></a> </td> <td> valid metadata buffer in bytes. </td> </tr> </table> <!-- Tabular view --> <table class="responsive fixed orange"> <colgroup><col width="214px"><col></colgroup> <tr><th colspan="2"><h2 class="add-link">Returns</h2></th></tr> <tr class="alt"> <td colspan="2"> Metadata in JSON format. </td> </tr> </table> <!-- Tabular view --> <table class="responsive fixed orange"> <colgroup><col width="214px"><col></colgroup> <tr><th colspan="2"><h2 class="add-link">Raises</h2></th></tr> <tr> <td> `ValueError`<a id="ValueError"></a> </td> <td> error occured when parsing the metadata schema file. </td> </tr> </table>