benchmarks
benchmarks copied to clipboard
Why reshape after bias_add ?
Notice codes HERE
biased = tf.reshape(
tf.nn.bias_add(
conv, biases, data_format=self.data_format),
conv.get_shape())
I think the output shape of bias_add is exactly the same as conv.get_shape().
So why bother to reshape?
Then I add some slim analyzer codes to print the total_ops
total_ops = slim.model_analyzer.analyze_ops(sess.graph)
I notice that total_ops
is different with reshape or not (Run Training)
With reshape: TOTAL_OPS = 4856506501 Without reshape: TOTAL_OPS = 3989465117
Of course the performance is also different.
Thank you for the note. We are checking it out. Sorry for the slow response.
Your findings have been confirmed internally with some basic testing, the next version will have it fixed assuming something very unexpected does not happen. In Q3 -2017 I hope to setup an auto sync so we can push out changes more often. Thank you again for the notice and information.
I am 99% sure this has been fixed. I looked at that section and unless I am just not seeing the reshape, it has been fixed. Sorry for the slow update and more sorry if I am reading the code wrong.
@tfboyd Hi, I still find the reshape after bias add, can you help to check it? add the code bellow. thanks. https://github.com/tensorflow/benchmarks/blob/master/scripts/tf_cnn_benchmarks/convnet_builder.py#L217
@reedwm will take it. Sorry maybe I missed it or there was some funny rollback. Either way very sorry.