-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tfjs-tflite: error after page refresh #8166
Comments
Is there any way to release the tfjs-tflite model's memory? - Like dispose in GraphModel. |
I solved this issue by following implementation:
Please, add it to documentation. |
Hi, @Jove125 I apologize for the delayed response and good to hear that you're able to resolve your issue and as far my current understanding 1. Dispose of Tensors: Explicitly release memory used by tensors after you're done with them:
2. Wrap Code in tf.tidy() : it will automatically dispose of all tensors created within a block as mentioned in this example tf.tidy NOTE: Variables do not get cleaned up when inside a tidy(). If you want to dispose variables, please use tf.disposeVariables() or call dispose() directly on variables. 3. Use Thank you for your valuable suggestion and solution, as you mentioned in your issue template it's happening on some devices so I'll discuss this issue in our internal meeting and will update you soon on adding this solution in our official documentation If possible could you please help me with your Github repo or code snippet ( along with model file) with complete steps which you followed before encountering the error so I'll go ahead and replicate the same behavior from my end also ? Thank you for your cooperation! |
Hi, @gaikwadrahul8, I had this error in the application that allocates memory not only for models, but also for textures, opencv.js and more. It is not so easy to reproduce the dump itself using only initialization of models (or the model should be "heavy"). But I specifically checked that the problem is after initializing the models (there was no error without loading the model, no matter how many times I refreshed the page). And it disappeared after implementing The memory used by the tab (and not just the application) should be monitored. |
Hi,
The error consistently occurs when performing a certain sequence of actions and only on some devices.
The error occurs during the second execution of one of the initialized models (the first execution occurs without errors, but before the initialization of the second model).
The error occurs on Honor 10 Lite, Readme Note 7 and does not occur on Google Pixel 4a 5G (possibly because there is 6 GB of RAM, but not 3 GB).
If you do not refresh the page after the first launch in the browser, but close it and open a new one, then the error does not occur.
Question: is there any way to completely clear the data/cache before initializing tfjs-tflite models?
The text was updated successfully, but these errors were encountered: