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/coco-ssd Uncaught (in promise) TypeError: Cannot read property 'read' of undefined with script tag example

See original GitHub issue

To get help from the community, we encourage using Stack Overflow and the tensorflow.js tag.

TensorFlow.js version

@tensorflow/tfjs@latest

Browser version

Chrome

Describe the problem or feature request

I used the example provided for the model coco-ssd with script tag but I get the following error : tfjs:17 Uncaught (in promise) TypeError: Cannot read property ‘read’ of undefined at tfjs:17 at u (tfjs:17) at Generator._invoke (tfjs:17) at Generator.forEach.t.<computed> [as next] (tfjs:17) at Wm (tfjs:17) at o (tfjs:17) at tfjs:17 at new Promise (<anonymous>) at tfjs:17 at tfjs:17

Code to reproduce the bug / link to feature request

<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs"> </script> <script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/coco-ssd"> </script> <script> // Notice there is no 'import' statement. 'cocoSsd' and 'tf' is // available on the index-page because of the script tag above. const img = document.getElementById('img'); // Load the model. cocoSsd.load().then(model => { // detect objects in the image. model.detect(img).then(predictions => { console.log('Predictions: ', predictions); }); }); </script>

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14

github_iconTop GitHub Comments

3reactions
aeggarutcommented, Aug 9, 2020

Choosing TFJS 2.0.0 works for me

1reaction
kalmufticommented, Aug 10, 2020

@Laurenceldp you can checkout my github repo for reference, it also has a Glitch app. feel free to test it and/or remix it at https://tfjswebcam.glitch.me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolving the JavaScript Promise Error "TypeError: Cannot ...
TypeError : Cannot read property 'then' of undefined. In this guide, we will cover two code examples containing a bugs that cause this...
Read more >
Uncaught (in promise) TypeError: Cannot read properties of ...
id is an number and cannot have address property. postData: {} - if it's supposed to be an array, don't define it as...
Read more >
Uncaught TypeError: Cannot read property of undefined In
Uncaught TypeError : Cannot read property of undefined error occurs in Chrome when you read a property or call a method on an...
Read more >
Uncaught TypeError cannot read property 'addeventlistener' of ...
In JavaScript, a very common error is the Uncaught TypeError Cannot read property 'addeventlistener' of null. This error occurs when JavaScript is not...
Read more >
TypeError: Cannot read property 'remove' of Undefined in JS
Placing the JS script tag above the HTML where the DOM elements are declared. ... const el = undefined; // ⛔️ Uncaught TypeError:...
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