I get the following error when I call loadLayersModel in vanilla javascript.
“Uncaught (in promise) TypeError: tf.loadLayersModel is not a function”
///
Here is my code:
import DeviceDetector from “https://cdn.skypack.dev/device-detector-js@2.2.10”;
import * as tf from “https://cdn.jsdelivr.net/npm/@tensorflow/tfjs/dist/tf.min.js”;
import React, { useEffect } from “https://cdn.skypack.dev/react”;
import ReactDOM from “https://cdn.skypack.dev/react-dom”;
// Usage: testSupport({client?: string, os?: string})
// Client and os are regular expressions.
// See: https://cdn.jsdelivr.net/npm/device-detector-js@2.2.10/README.md for
// legal values for client and os
(async () => {
const model1 = await tf.loadLayersLModel(
‘https://senyasfsltranslator.s3.jp-tok.cloud-object-storage.appdomain.cloud/model.json’);
model1.summary();
})();
///
Has anyone else encountered this error?