【发布时间】:2019-05-08 19:19:32
【问题描述】:
我有一个 Angular 7 应用程序,我正在尝试按照 this 示例加载 mobilenet 模型。
我通过运行npm install @tensorflow/tfjs(按照this 指令)安装了tensorflowjs,并通过运行@tensorflow-models/mobilenet 安装了mobilenet 模型。
之后我通过这样做导入了移动网络:
import * as mobilenet from '@tensorflow-models/mobilenet';
并执行以下代码以加载模型:
mobilenet.load().then(() => {
obs.next();
}).catch((err) => {
console.log(err);
console.log("ERROR");
});
但我收到以下错误:
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)
有人知道是什么问题吗?
【问题讨论】:
标签: javascript angular typescript tensorflow tensorflow.js