TensorFlow
TensorFlow.js is a library for machine learning in JavaScript.
Before Content Rendering
Version mismatch
Plug-in libraries may change their versions and the code in the example may not work or cause an error.
Use the following for the JavaScript->Before Content Rendering:
console.log('Loading TensorFlow...');
import("https://cdnjs.cloudflare.com/ajax/libs/tensorflow/4.22.0/tf.fesm.min.js").then(tf => {
console.log('Done loading TensorFlow');
console.log('Check if TensorFlow if ready');
tf.ready().then(() => {
console.log('TensorFlow is ready');
console.log('TensorFlow version: ', tf.version);
console.log('TensorFlow backend: ', tf.getBackend());
}
})