ikhlestov / vision_networks

Repo about neural networks for images handling

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

batch_norm in dense_net.py

jzhoulon opened this issue · comments

Hi, we found that in dense_net.py, its batch_norm used with tf.contrib.layers.batch_norm api rather than tf.nn.fused_batch_norm api, is there any reason for specific using contrib.layers.batch_norm api? because in current intel mkldnn backend, contrib.layers has much overhead compared with nn.fused_batch_norm.

Hi, that may be a case, but the main reason I've used batch norm from contrib layers is that I've implemented this network few years ago when no alternatives exist. I may try those layers later sometimes. Or you may change them and provide PR.
Last but not least - I've made this code just as an export from authors caffe code to the tensorflow. And they used usual batch normalization. So maybe we should consider using at least tf.nn.batch_normalization method to be on par with the original code.