Reputation: 123
I copied the code from tfjs-examples/mobilenet/ and try to run my own frozen model, the model was loaded, but producing error when I try to use predict
method.
I'm using tfjs of version 0.14.2
and Google Chrome, version 71.0.3578.98
I used the mobilenet example shown in tfjs-examples repo and started the server by yarn watch
.
Secondly, I loaded my own FrozenModel successfully.
But when I use the predict
method of the loaded model with a input of correct shape, it shown the error below:
ERROR: 0:163: 'updates' : left of '[' is not of type array, matrix, or vecto
I just slightly modified the original index.js
in the mobilenet example and the script look like this:
import * as tf from '@tensorflow/tfjs';
const MODEL_URL = 'path_to_tensorflowjs_model.pb';
const WEIGHTS_URL = 'path_to_weights_manifest.json';
let gan;
const ganDemo = async () => {
status('Loading model...');
gan = await tf.loadFrozenModel(MODEL_URL, WEIGHTS_URL);
gan.predict(tf.zeros([1, 3, 450, 300])).dispose(); # error here
...
I had made sure the model was loaded successfully, and the shape of the input is correct (I intentionally tried other shape, and if the shape is not correct, it will throw another error)
Any suggestions is appreciated.
Upvotes: 0
Views: 148