PAIR-code / federated-learning

Federated learning experiment using TensorFlow.js
Apache License 2.0
160 stars 31 forks source link

Error in Emoji hunt demo #43

Open v7t-codes opened 6 years ago

v7t-codes commented 6 years ago

I get the following error when I run yarn dev to setup the federated server

RangeError: Invalid typed array length: 424424 at new Float32Array (<anonymous>) at /home/psi/flp/federated-learning/demo/emoji_hunt/server/.yalc/federated-learning-server/dist/models.js:391:19 at Array.map (<anonymous>) at flatDeserialize (/home/psi/flp/federated-learning/demo/emoji_hunt/server/.yalc/federated-learning-server/dist/models.js:388:24) at FederatedServerDynamicModel.<anonymous> (/home/psi/flp/federated-learning/demo/emoji_hunt/server/.yalc/federated-learning-server/dist/models.js:334:36) at step (/home/psi/flp/federated-learning/demo/emoji_hunt/server/.yalc/federated-learning-server/dist/models.js:42:23) at Object.next (/home/psi/flp/federated-learning/demo/emoji_hunt/server/.yalc/federated-learning-server/dist/models.js:23:53) at fulfilled (/home/psi/flp/federated-learning/demo/emoji_hunt/server/.yalc/federated-learning-server/dist/models.js:14:58)

Here is the snippet that the error points to: 381: exports.flatSerialize = flatSerialize; function flatDeserialize(_a) { var data = _a.data, _b = _a.json, meta = _b.meta, byteOffsets = _b.byteOffsets; var numels = meta.map(function (_a) { var shape = _a.shape; return shape.reduce(function (x, y) { return x * y; }, 1); }); var tensors = meta.map(function (_a, i) { var shape = _a.shape, dtype = _a.dtype; var ctor = common_1.dtypeToTypedArrayCtor[dtype]; var arr = new ctor(data.buffer, byteOffsets[i], numels[i]); return tf.tensor(arr, shape, dtype); }); return tensors; 395: }

raghu20ram commented 5 years ago

hi @vishwajit123 how did you run the demo , I am facing issues while running the demo?