tfjs-models/coco-ssd Uncaught (in promise) TypeError: Cannot read property 'read' of undefined with script tag example
See original GitHub issueTo get help from the community, we encourage using Stack Overflow and the tensorflow.js
tag.
TensorFlow.js version
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:
- Created 3 years ago
- Comments:14
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Choosing TFJS 2.0.0 works for me
@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.