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.

Error: Tensor is disposed

See original GitHub issue

Hi @justadudewhohacks ,

I’m getting the following after performing the below steps:

  1. load models using faceapi.loadModels('assets/models/') (this is successful)
  2. invoke faceapi.allFaces(input, this.minConfidence).then(.. (where input is the id to a image element. This fails with below error).

core.js:1449 ERROR Error: Uncaught (in promise): Error: Tensor is disposed. Error: Tensor is disposed. at t.throwIfDisposed (face-api.min.js:1) at t.asType (face-api.min.js:1) at t.toFloat (face-api.min.js:1) at face-api.min.js:1 at Array.map (<anonymous>) at face-api.min.js:1 at t.tidy (face-api.min.js:1) at rc (face-api.min.js:1) at face-api.min.js:1 at t.tidy (face-api.min.js:1) at t.throwIfDisposed (face-api.min.js:1) at t.asType (face-api.min.js:1) at t.toFloat (face-api.min.js:1) at face-api.min.js:1 at Array.map (<anonymous>) at face-api.min.js:1 at t.tidy (face-api.min.js:1) at rc (face-api.min.js:1) at face-api.min.js:1 at t.tidy (face-api.min.js:1) at c (polyfills.js:3) at c (polyfills.js:3) at polyfills.js:3 at t.invokeTask (polyfills.js:3) at Object.onInvokeTask (core.js:4751) at t.invokeTask (polyfills.js:3) at r.runTask (polyfills.js:3) at o (polyfills.js:3) at e.invokeTask (polyfills.js:3) at i.isUsingGlobalCallback.invoke (polyfills.js:3)

Did I forget to do sth? Sorry, not familiar with how tensors work so maybe its a stupid question.

Thanks

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
justadudewhohackscommented, Jul 2, 2018

So the error occurs when you are additionally including the tfjs script to face-api.js? Does it work with tfjs-core?

Not sure if there are issues, when you are using tfjs additionally, because someone seemed to have issues with this in #9. In case tfjs-core is enough for your application, you can also access the bundled version via faceapi.tf.

0reactions
bharathvaj-ganesancommented, Jul 22, 2018

So it works with tfjs-core but not with tfjs? @justadudewhohacks No. It doesnot work with both (tfjs & tfjs-core). It throws “Tensor disposed Error” for tfjs-core. image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do I receive the Error: Tensor is disposed, when using tf ...
Fork tensorflow/tfjs-models from head, and revert the model-loading part to use tf.loadLayersModel() with the BASE_PATH that was removed in #161 ...
Read more >
Tensorflow.js tf.dispose() Function - GeeksforGeeks
.dispose() function is used to dispose a tensor to the memory. ; Syntax: ; Parameters: this method don't have any parameters ; Return...
Read more >
Creates a tf.Tensor with the provided values, shape and dtype.
Pass an array of values to create a vector. tf.tensor([1, 2, 3, ... dispose () method Source ... It is an error to...
Read more >
Tensor creation performance bottleneck - Google Groups
I.e., create a kind of symbolic tensor with empty data, then supply new data whenever the symbolic tensor is to be used, in...
Read more >
@tensorflow/tfjs-core.Tensor.dispose JavaScript and Node.js ...
const predictions = await model.classify(image); image.dispose(); // Tensor memory must be managed explicitly (it is not sufficient to let a tf.
Read more >

github_iconTop Related Medium Post

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