hub icon indicating copy to clipboard operation
hub copied to clipboard

Performance issue in /examples/image_retraining (by P3)

Open DLPerf opened this issue 4 years ago • 2 comments

Hello! I've found a performance issue in /examples/image_retraining/retrain.py: eval_sess = tf.Session(graph=eval_graph)(here) is defined in the function build_eval_session(here) which is called in the function save_graph_to_file(here) which is repeatedly called in the loop for i in range(FLAGS.how_many_training_steps)(here).

tf.Session being defined repeatedly could lead to incremental overhead. If you define tf.Session out of the loop and pass tf.Session as a parameter to the loop, your program would be much more efficient. Here is the Stack Overflow post to support it.

Looking forward to your reply. Btw, I am very glad to create a PR to fix it if you are too busy.

DLPerf avatar Aug 25 '21 11:08 DLPerf

Hi @DLPerf, this code is also deprecated, but you are always welcome to file a PR to improve things.

MorganR avatar Oct 15 '21 10:10 MorganR

@DLPerf

Could you please confirm if you have filed the PR mentioned.Thanks

UsharaniPagadala avatar Nov 02 '21 11:11 UsharaniPagadala

@DLPerf,

This code is deprecated, still you can create a PR with fix to improve performance. Thank you for contributing!

singhniraj08 avatar Oct 18 '22 04:10 singhniraj08

Closing due to inactivity.

WGierke avatar Nov 24 '22 10:11 WGierke