问题
Trying to recreate the emoji scavenger hunt from google and it returned me the following error:
Here is my only code that is running at the moment:
import * as tf from '@tensorflow/tfjs';
import { loadFrozenModel, FrozenModel } from '@tensorflow/tfjs-converter';
export default class MobileNet {
constructor() { }
async load() {
const MODEL_URL = '/assets/project-gaea/models/web_model.pb';
const WEIGHTS_URL = '/assets/project-gaea/models/weights_manifest.json';
const model = await loadFrozenModel(MODEL_URL, WEIGHTS_URL);
const cat = document.getElementById('cat');
model.execute({input: tf.fromPixels(cat)});
}
}
回答1:
Discovered that the error was being caused by an upgraded version of tfjs-core and tfjs-converter. I downgraded it according to the demo and seems to be working. a long term solution as it still doesnt solve the problem for new developers. Raised it in GitHub too
来源:https://stackoverflow.com/questions/50521961/tensorflow-js-returning-typeerror-cannot-read-property-concat-of-undefined-wh