serizba / cppflow

Run TensorFlow models in C++ without installation and without Bazel
https://serizba.github.io/cppflow/
MIT License
779 stars 177 forks source link

cppflow leaks memory #171

Closed ghost closed 2 years ago

ghost commented 2 years ago

Ok, I did a test and Tensorflow does release gpu memory. So, cppflow leaks somewhere.

ljn917 commented 2 years ago

Is it possible for you to upload your full tests somewhere so that we can fix it? Thanks.

On Sun, Jan 23, 2022, 03:46 TensorMechanic @.***> wrote:

Ok, I did a test and Tensorflow does release gpu memory. So, cppflow leaks somewhere.

— Reply to this email directly, view it on GitHub https://github.com/serizba/cppflow/issues/171, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALDTHR3CEQXLFVELVGYO6TUXO57ZANCNFSM5MTCK5IQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

ghost commented 2 years ago

meh, tensorflow is balls even my little cuda tensor is 1000x faster than it.

ghost commented 2 years ago

I do not think cppflow was meant to do what I am doing to it so it works fine for loading python models that behave properly. I am going back to Torch because i like it much better. Thank you.

ghost commented 2 years ago

To answer your question I am trying to use it like Torch but it doesn't work that way.

ghost commented 2 years ago

Ok I did another test this time creating massive amounts of cppflow::tensor and no leak, so in conclusion my code is retarded somewhere and has a bug. Sorry guys.

ljn917 commented 2 years ago

FYI, are you doing something like below, i.e. calling raw_ops directly instead of loading models? For performance, I heard the eager mode was slow but never test it in C++. https://github.com/serizba/cppflow/blob/4be8da9d838501820cc8a7513324ca19215dab47/examples/eager_op_multithread/main.cpp#L11-L21