TensorFlow.js version
tensorflow/tfjs-core@0.15.2
Browser version
chrome 72.0.3626.109 for mac
Describe the problem or feature request
I tried the demo tfjs-examples-webcam-transfer-learning in tensorflow/tfjs-examples. In the file index.js, tensorflow tried to load the model like below:
const mobilenet = await tf.loadModel(
'https://storage.googleapis.com/tfjs-models/tfjs/mobilenet_v1_0.25_224/model.json'
);
But every time I run this demo, it will run this sentence and download the model. I want to make it load from local server. So I download the model.json and put it in the assets folder. Then I deploy the assets in the local server at port 1234. load it like this:
const mobilenet = await tf.loadModel(
'http://localhost:1234/json/model.json'
);
But it didn't work and the consoled out
io_utils.ts:116 Uncaught (in promise) RangeError: byte length of Float32Array should be a multiple of 4
at new Float32Array (<anonymous>)
at o (io_utils.ts:116)
at Object.decodeWeights (io_utils.ts:79)
at models.ts:318
at common.ts:14
at Object.next (common.ts:14)
at o (common.ts:14)
I'm really sure that the model.json is the same as in https://storage.googleapis.com/tfjs-models/tfjs/mobilenet_v1_0.25_224/model.json, but why id didn't work?
Thanks for helping me.