tensorflow/lite/g3doc/api_docs/python/tflite_support/metadata/convert_to_json.md
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>View source on GitHub
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>