tfjs icon indicating copy to clipboard operation
tfjs copied to clipboard

Uncaught (in promise) TypeError: backend.incRef is not a function

Open JeongJun-Lee opened this issue 3 years ago • 2 comments

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): Mac 10.15.7
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
  • TensorFlow.js installed from (npm or script link): npm
  • TensorFlow.js version (use command below): 3.20.0
  • Browser version: Chromium 87.0.4280.47
  • Tensorflow.js Converter Version: 3.20.0

Describe the current behavior I tried the tutorial for offline usage. When I tried it with model data(multi-pose lightning) from tensorflow-hub and tfjs-backend-webgl, errors below comes out:

Describe the expected behavior It should be executed without 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. Almost same as https://github.com/andypotato/tfjs-electron-template

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.

2f696093-1d70-48aa-9c63-656f5530b5a9:9551 Uncaught (in promise) TypeError: backend.incRef is not a function at Object.identity [as kernelFunc] (2f696093-1d70-48aa-9c63-656f5530b5a9:9551) at kernelFunc (2f696093-1d70-48aa-9c63-656f5530b5a9:1115) at 2f696093-1d70-48aa-9c63-656f5530b5a9:1195 at Engine.scopedRun (2f696093-1d70-48aa-9c63-656f5530b5a9:935) at Engine.runKernelFunc (2f696093-1d70-48aa-9c63-656f5530b5a9:1188) at Engine.runKernel (2f696093-1d70-48aa-9c63-656f5530b5a9:1022) at clone_ (2f696093-1d70-48aa-9c63-656f5530b5a9:16906) at clone__op (2f696093-1d70-48aa-9c63-656f5530b5a9:192) at cloneTensor (2f696093-1d70-48aa-9c63-656f5530b5a9:4311) at _callee2$ (2f696093-1d70-48aa-9c63-656f5530b5a9:83305)

JeongJun-Lee avatar Aug 30 '22 11:08 JeongJun-Lee

Can you please check for a similar issue here https://github.com/tensorflow/tfjs/issues/4405 ?

rthadur avatar Aug 30 '22 15:08 rthadur

I already checked it, but the last func in the callstack is different from the issue. The func in the #4406 is reshape() ,but in this issue, the func is Object.identity().

JeongJun-Lee avatar Aug 30 '22 18:08 JeongJun-Lee

Facing similar issue, but related to reshape(). Trying to load the model in Angular.

Code: `` import * as tf from '@tensorflow/tfjs';

    const model = await tf.loadLayersModel('../../assets/model3/model.json');
    console.log(model.predict(tf.tensor(new_sequence,[1,30],'int32')));

ERROR Error: Uncaught (in promise): TypeError: webglBackend.incRef is not a function TypeError: webglBackend.incRef is not a function at reshape (Reshape.js:36:18) at Object.min [as kernelFunc] (Min.js:37:24) at h (engine.js:562:22) at engine.js:619:23 at e.scopedRun (engine.js:436:19) at e.runKernelFunc (engine.js:616:10) at e.runKernel (engine.js:494:17) at min_ (min.js:55:12) at Module.min__op (operation.js:44:28) at Module.min (math_utils.js:64:12) at resolvePromise (zone.js:1211:31) at zone.js:1118:17 at zone.js:1134:33 at asyncGeneratorStep (asyncToGenerator.js:6:1) at _throw (asyncToGenerator.js:29:1) at _ZoneDelegate.invoke (zone.js:372:26) at Object.onInvoke (core.mjs:26231:33) at _ZoneDelegate.invoke (zone.js:371:52) at Zone.run (zone.js:134:43) at zone.js:1275:36

Sri-harsha99 avatar Sep 28 '22 06:09 Sri-harsha99

Hi, can you provide a reproducible code so that we can debug from there? Thank you.

lina128 avatar Sep 28 '22 16:09 lina128

Hi @JeongJun-Lee , I apologize for the delay in responding. In order to investigate the issue you are experiencing, could you please share the reproducible code? I believe the issue is caused by importing the same package with different versions. Please follow the instructions in the comment and let us know if the issue is resolved. Thank You !!

shmishra99 avatar May 26 '23 16:05 shmishra99

This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.

github-actions[bot] avatar Jun 03 '23 02:06 github-actions[bot]

This issue was closed due to lack of activity after being marked stale for past 7 days.

github-actions[bot] avatar Jun 11 '23 02:06 github-actions[bot]

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

google-ml-butler[bot] avatar Jun 11 '23 02:06 google-ml-butler[bot]