posenet on an Iphone error: RangeError: Maximum call stack size exceeded.

55 views
Skip to first unread message

James Cannan

unread,
Mar 16, 2021, 5:20:33 AM3/16/21
to TensorFlow.js Discussion
Hi All,

I am having problems trying to run posenet on an Iphone11 using react native. It comes up with a: RangeError: Maximum call stack size exceeded.

Here is an extract from my code which is based on posenet example from:  https://www.npmjs.com/package/@tensorflow-models/posenet

 const theModel = await posenet.load();

const imgB64 = await FileSystem.readAsStringAsync(image.uri, {
encoding: FileSystem.EncodingType.Base64,
});
const imgBuffer = tf.util.encodeString(imgB64, 'base64').buffer;
const raw = new Uint8Array(imgBuffer)
const imageTensor = await decodeJpeg(raw);

const pose = await model.estimateSinglePose(imageTensor, {
flipHorizontal: false
});

I got it working in the browser using react, but on the iphone it seems like i don't have enough memory to load posenet.

Any help would be greatly appreciated.

Thank you
Reply all
Reply to author
Forward
0 new messages