question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[tfjs-models] memory access out of bounds error in pose-detection demo

See original GitHub issue

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow.js): Yes
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows 10
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: No
  • TensorFlow.js installed from (npm or script link): https://unpkg.com/@tensorflow/tfjs-core@latest/dist/tf-core.js
  • TensorFlow.js version (use command below): 3.7.0
  • Browser version: 91.0.4472.114
  • Tensorflow.js Converter Version:

Describe the current behavior Met RuntimeError: memory access out of bounds when use wasm backend in posenet model.

Describe the expected behavior Should not met Error

Standalone code to reproduce the issue Provide a reproducible test case that is the bare minimum necessary to generate the problem. If possible, please share a link to Colab/CodePen/any notebook.

  1. Add wasm backend to poseNet model.
diff --git a/pose-detection/demos/live_video/src/params.js b/pose-detection/demos/live_video/src/params.js
index 3ddf62e..66cdb98 100644
--- a/pose-detection/demos/live_video/src/params.js
+++ b/pose-detection/demos/live_video/src/params.js
@@ -80,7 +80,7 @@ export const BACKEND_FLAGS_MAP = {
 };

 export const MODEL_BACKEND_MAP = {
-  [posedetection.SupportedModels.PoseNet]: ['tfjs-webgl'],
+  [posedetection.SupportedModels.PoseNet]: ['tfjs-webgl', 'tfjs-wasm'],
   [posedetection.SupportedModels.MoveNet]: ['tfjs-webgl', 'tfjs-wasm'],
   [posedetection.SupportedModels.BlazePose]:
       isiOS() ? ['tfjs-webgl'] : ['mediapipe-gpu', 'tfjs-webgl']
  1. yarn watch
  2. Visit http://localhost:1234/?model=posenet
  3. select “tfjs-wasm”

Other info / logs Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
lina128commented, Jun 24, 2021

Right, WASM is not supported, it’s either too slow to run or throws memory access out of bounds error.

0reactions
google-ml-butler[bot]commented, Jul 1, 2021

Are you satisfied with the resolution of your issue? Yes No

Read more comments on GitHub >

github_iconTop Results From Across the Web

HandPoseDetection demo error on wasm backend #6128
It works well with WebGL backend, but once I am switching to WebAssembly I get an error: RuntimeError: memory access out of bounds...
Read more >
TFJS returns memory access out of bound error?
This function used to remove background from a selfie image, and this runs on a mobile device, and if this function runs more...
Read more >
memory access out of bounds – but why? - Stack Overflow
in my assemblyscript code I'm not even accessing the preallocated memory and still get a RuntimeError: memory access out of bounds .
Read more >
Is there a way to allocate more memory to a jail? My ... - Reddit
My NextCloud jail is running the Recognize plugin and that keeps spitting out 'memory access out of bounds' errors.
Read more >
James Thomas - notes on software.
The tfjs-models/mobilenet library exposes a classify method on the MobileNet class to return the top X classes with highest probabilities from ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found