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.

tflite: tfjs-backend-cpu: Uncaught TypeError: Cannot read property 'whereImpl' of undefined

See original GitHub issue

System information

  • OS Platform and Distribution: Ubuntu 20.04
  • TensorFlow.js version: Latest as of writing
  • Browser version: Chrome 92

The “Via a script tag” instructions from the tfjs-tflite readme don’t work:

<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-cpu"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-core"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-tflite"></script>
<script>
  (async function() {
    const tfliteModel = await tflite.loadTFLiteModel('https://tfhub.dev/tensorflow/lite-model/mobilenet_v2_1.0_224/1/metadata/1');
  })();
</script>

image

But this works fine:

<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@3.8.0/dist/tf.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-tflite@0.0.1-alpha.4/dist/tf-tflite.min.js"></script>
<script>
  (async function() {
    const tfliteModel = await tflite.loadTFLiteModel('https://tfhub.dev/tensorflow/lite-model/mobilenet_v2_1.0_224/1/metadata/1');
  })();
</script>

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
jinjingforevercommented, Aug 26, 2021

Good ideas! Thanks @josephrocca. Will update README with versioned links for now.

1reaction
jinjingforevercommented, Aug 26, 2021

I just realized that we do have the correct instructions in the README file in the master branch. I will publish a new version to npm soon (maybe in the next 1-2 weeks). Thank you! Closing this issue for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'backend' of undefined #4296
I'm using the latest version of tfjs-node on npm: { "peerDependencies": { "@tensorflow/tfjs-core": "^2.4.0" }, "dependencies": ...
Read more >
Unable to load Node backend for Tensorflow (TypeError
Unable to load Node backend for Tensorflow (TypeError: Cannot read property 'nonMaxSuppressionV3Impl' of undefined) · Ask Question. Asked 2 ...
Read more >
Cannot read properties of undefined (reading 'backend') - TF.js
Hi everyone, I am experiencing the following error in my code: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ...
Read more >
Error in installing node-red-contrib-tf-model - General
Could not resolve dependency: npm ERR! peer ... TypeError: Cannot read property 'whereImpl' of undefined 17 Oct 06:53:50 - [warn] ...
Read more >
@tensorflow/tfjs-backend-cpu - npm
Start using @tensorflow/tfjs-backend-cpu in your project by running `npm i @tensorflow/tfjs-backend-cpu`. There are 35 other projects in the ...
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