hub
hub copied to clipboard
Performance issue in /examples/image_retraining (by P3)
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.
Hi @DLPerf, this code is also deprecated, but you are always welcome to file a PR to improve things.
@DLPerf
Could you please confirm if you have filed the PR mentioned.Thanks
@DLPerf,
This code is deprecated, still you can create a PR with fix to improve performance. Thank you for contributing!
Closing due to inactivity.