tensorflow / tfjs

A WebGL accelerated JavaScript library for training and deploying ML models.
https://js.tensorflow.org
Apache License 2.0
18.52k stars 1.94k forks source link

Build stack trace for tensor creation / disposal #914

Open annxingyuan opened 6 years ago

annxingyuan commented 6 years ago

For reference: https://github.com/tensorflow/tfjs-core/blob/master/src/engine.ts#L303

DirkToewe commented 6 years ago

The idea would be to save a stack trace on Tensor creation and disposal (e.g. via new Error()). Those stack traces could then be used to improve error messages. If, for example, a "Tensor already disposed" error is thrown, additional info could be logged ("The tensor was created here and was disposed there").

This should be an opt-out feature because creating the stack trace may be slow on problems involving only small tensors.

gaikwadrahul8 commented 1 year ago

Hi, @annxingyuan

Thank you for opening this issue for tracking purposes. Since this issue has been open for a long time, the code/debug information for this issue may not be relevant with the current state of the code base.

The TFJs team is constantly improving the framework by fixing bugs and adding new features. We suggest you try the latest TFJs version with the latest compatible hardware configuration which could potentially resolve the issue. We can keep the issue open if it is still relevant. Please confirm if we need to keep the issue open.

Thank you for your support and cooperation.