tfjs icon indicating copy to clipboard operation
tfjs copied to clipboard

model.predict() takes a lot of time . this causes physical lag in the tensor camera . how to fix ?

Open arpitKohli112 opened this issue 3 years ago • 4 comments

it takes 400ms or so to give a prediction this lags the tensor camera . how to make it fast ? im using webgl as backend as I think its the fastest one . other backends takes even more time . I created a model using teachable machine is this the problem ? pls help .

arpitKohli112 avatar Jan 02 '23 08:01 arpitKohli112

Hi, @arpitKohli112

Apologize for the delayed response and Could you please help us with your codepen example or Github repo link in which model.predict() taking more time, at the moment without code snippet it's difficult to tell what's causing the issue in your code

If you're not using below api's in your code then it may cause the issue so please try to use below api's in your code to avoide memory leak or performance related issue, I hope it will help you to resolve your issue

If issue still persists please help us with code snippet to find out the root cause for your issue. Thank you!

  1. tf.tidy
  2. tf.dispose
  3. tf.keep
  4. tf.memory

gaikwadrahul8 avatar Jul 28 '23 09:07 gaikwadrahul8

This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.

github-actions[bot] avatar Aug 05 '23 01:08 github-actions[bot]

This issue was closed due to lack of activity after being marked stale for past 7 days.

github-actions[bot] avatar Aug 13 '23 01:08 github-actions[bot]

Are you satisfied with the resolution of your issue? Yes No

google-ml-butler[bot] avatar Aug 13 '23 01:08 google-ml-butler[bot]