I am working on an Angular 7 application and attempting to load the mobilenet model by following the instructions in this example.
To do this, I first installed tensorflowjs using the command npm install @tensorflow/tfjs
(based on the steps provided in this guide) and then installed the mobilenet model with @tensorflow-models/mobilenet
.
Next, I imported the mobilenet model as follows:
import * as mobilenet from '@tensorflow-models/mobilenet';
I proceeded to execute the code below to load the model:
mobilenet.load().then(() => {
obs.next();
}).catch((err) => {
console.log(err);
console.log("ERROR");
});
However, I encountered the following error message:
TypeError: Cannot read property 'fetch' of undefined
at new e (tf-core.esm.js:17)
at browserHTTPRequest (tf-core.esm.js:17)
at httpRequestRouter (tf-core.esm.js:17)
at tf-core.esm.js:17
at Array.forEach (<anonymous>)
at Function.e.getHandlers (tf-core.esm.js:17)
at Function.e.getLoadHandlers (tf-core.esm.js:17)
at Object.getLoadHandlers (tf-core.esm.js:17)
at e.findIOHandler (tf-converter.esm.js:17)
at e.<anonymous> (tf-converter.esm.js:17)
Seeking assistance to resolve this issue. Any insights would be greatly appreciated.