Skip to content

Commit

Permalink
Explicitly use version major and minor for version control
Browse files Browse the repository at this point in the history
Optimised code for TF 1.0.1 as well. We only check major and minor
version number now. Everything < 0.11 uses different key name
  • Loading branch information
indradenbakker committed Mar 24, 2017
1 parent 7617465 commit e907abe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vehicle-detection/darkflow/net/ops/convolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ def batchnorm(self, layer, inp):
'updates_collections' : None,
'is_training': layer.h['is_training']
})
v = tf.__version__
if int(v) < 0.12: key = 'initializers'
v_ma = tf.__version__.split('.')[0]
v_mi = tf.__version__.split('.')[1]
if int(v_ma) < 1 & int(v_mi) < 12: key = 'initializers'
else: key = 'param_initializers'
args.update({key : layer.w})
return slim.batch_norm(inp, **args)
Expand Down

0 comments on commit e907abe

Please sign in to comment.