Tensorflow.js load latest API and find/display the version
Working on Tensorflow.js API and wanted to find out how to accomplish the following:
- Load the latest Tensorflow.js API without recourse to the version number.
- Find out or print out the version of the library loaded.
-
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-vis@1.0.2/dist/tfjs-vis.umd.min.js"> </script>
-
Add an event listener at the bottom of your htlm page, extract the version and spew it out to a place holder.
<div id="version"> </div> <script>
window.addEventListener('load', (event) => { document.getElementById("version").innerHTML = "Version :" + JSON.stringify(tf.version.tfjs); });
</script>
Comments
Post a Comment