Closed hyufeng closed 5 years ago
@summerscar
依赖引入按照这边的example呢 https://github.com/tensorflow/tfjs-models/tree/master/knn-classifier#via-npm @hyufeng
问题已经解决啦,是@tensorflow/tfjs这个库的版本更新啦,恢复到原来的0.10.0版本就解决啦
Uncaught (in promise) TypeError: tf.loadLayersModel is not a function
at MobileNet.
update my @tensorflow/tfjs update package but error is same. Uncaught (in promise) TypeError: tf.loadLayersModel is not a function at MobileNet. (mobilenet.js:1132:1) at step (mobilenet.js:55:1) at Object.next (mobilenet.js:36:1) at mobilenet.js:29:1 at new Promise () at __awaiter (mobilenet.js:25:1) at ./node_modules/blockzie-vm/src/extensions/scratch3_knn/mobilenet.js.MobileNet.load (mobilenet.js:1124:1) at Object. (mobilenet.js:1106:1) at step (mobilenet.js:55:1) at Object.next (mobilenet.js:36:1)
os: win10 chrome: 77.0.3865.90(正式版本) (64 位) node: v12.9.0
导入代码: ` require('babel-polyfill'); const Runtime = require('../../engine/runtime');
const Clone = require('../../util/clone'); const Cast = require('../../util/cast'); const Video = require('../../io/video'); const formatMessage = require('format-message');
const tf = require('@tensorflow/tfjs'); const mobilenetModule = require('./mobilenet'); const knnClassifier = require('@tensorflow-models/knn-classifier'); `
重现错误: 安装依赖后,复制代码,点击插件图标后,在console中报此错。