Tensorflow-JS-Examples icon indicating copy to clipboard operation
Tensorflow-JS-Examples copied to clipboard

avoiding dataSync() in neuro-evolution example

Open shiffman opened this issue 6 years ago • 1 comments

In the interest of getting the thing working, I just used dataSync() out of convenience. I should probably avoid it and run predict() asynchronously. This will be tricky to align with p5's draw() loop.

shiffman avatar Apr 09 '19 19:04 shiffman

depending on how long it takes (im fairly new) to fetch it async you can save it to a promise and check if the promise completed before drawing the next frame probably gonna introduce a bit more lagging though (on second thought probably not since it should take about the same time to fetch the data from the gpu , but it might skip a frame or two)

jonnytest1 avatar May 19 '19 22:05 jonnytest1