Skip to content
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

Increase of memory and excecution time #45

Closed
abhijithrb opened this issue Sep 26, 2017 · 7 comments
Closed

Increase of memory and excecution time #45

abhijithrb opened this issue Sep 26, 2017 · 7 comments

Comments

@abhijithrb
Copy link

Hi @dpressel ,
First of, thank you for this amazing project!
Coming to my issue, when I try running guess.py for a batch of images, the memory and execution time increases for each image. I checked memory using the 'top' and noticed the memory and cpu usage would constantly increase and eventually the program would crash.
I did a bit of digging and found this link where mrry suggests tcmalloc. I also came across couple of other links where this has been suggested but this didn't seem to make a difference.
Any ideas as to how to solve this?

@abhijithrb
Copy link
Author

abhijithrb commented Oct 14, 2017

I figured out the issue. In the utils.py, there are Ops that get added to the graph with each iteration of the loop in both the "crop_batch" functions, which led to an increase in memory usage. I solved it by restructuring the "ImageCoder" class such that the ops are added to the graph just once.
@dpressel I'm closing this issue if that's okay!

@dpressel
Copy link
Owner

Hi, sorry I did not get back to you sooner, have been swamped. I would consider merging a PR if you have something that solves the issue cleanly.

@abhijithrb
Copy link
Author

Hello,
I have forked your project and made the changes to my repository.
The master branch is modified to suit my application to run both age and gender models in the same program and takes care of the memory issue as well. The second branch runs the same way your project runs but takes care of the memory issue. The major changes are in the utils.py file.
I'll make a PR for the second branch.

@nuptwuchen
Copy link

Its sad to say the execution time is still add ( little ) when I try to run guess.py for a batch of images. I am try ing to solve it, however I am not do well in it. My computer is two titian-xp, it still cost 1s to comput a pic (gender) in the beginning, how can i do fast, because i have to deal a huge image data.

@sxhysj
Copy link

sxhysj commented Jan 28, 2018

I manage to make it faster by applying TensorFlow-Serving-API and i suggest you to do so.

@nuptwuchen
Copy link

thanks

@lidan528
Copy link

Hi @dpressel ,
First of, thank you for this amazing project!
Coming to my issue, when I try running guess.py for a batch of images, the memory and execution time increases for each image. I checked memory using the 'top' and noticed the memory and cpu usage would constantly increase and eventually the program would crash.
I did a bit of digging and found this link where mrry suggests tcmalloc. I also came across couple of other links where this has been suggested but this didn't seem to make a difference.
Any ideas as to how to solve this?

Many thanks! I had the same problem and fixed it thanks to your inspiration. By the way, your modified code of "utils.py" remains a small probelm: missed the standardize_image operation after flip operation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants