CSBDeep / CSBDeep_fiji

BSD 2-Clause "Simplified" License
11 stars 4 forks source link

Free GPU and system memory #10

Closed HedgehogCode closed 6 years ago

HedgehogCode commented 6 years ago

Tobias Boothe reported that if the plugin is executed in a loop the GPU memory will grow full and at some point, you have to restart Fiji.

frauzufall commented 6 years ago

Thanks, I'll investigate!

HedgehogCode commented 6 years ago

I think it could have something to do with session.close() of org.tensorflow.Session. The Javadoc says:

WARNING: A Session owns resources that must be explicitly freed by invoking close().

And I am not sure if we call close() somewhere.

HedgehogCode commented 6 years ago

I have added a model.session().close() after the plugin execution finished. But I didn't test it yet.

HedgehogCode commented 6 years ago

@frauzufall can you test it, or should I set up an environment where I can test it?

Edit: Actually, I realized that it's not too hard for me to test it. I will do it right now.

frauzufall commented 6 years ago

Hey @HedgehogCode, thanks for all the work! and sorry for me not being very responsive right now. I am refactoring the code whenever I got some time to make it better readable, I will add your changes to my version as well and create a PR to discuss as soon as possible. We should also talk about if some part of our work should go into imagej-tensorflow.