Ssd_keras: TypeError: l2_normalize() got an unexpected keyword argument 'axis'

Created on 12 Apr 2018  路  3Comments  路  Source: rykov8/ssd_keras

hello,when i run the file SSD_training.ipynb, it give this erro:

TypeError Traceback (most recent call last)
in ()
----> 1 model = SSD300(input_shape, num_classes=NUM_CLASSES)
2 model.load_weights('weights_SSD300.hdf5', by_name=True)

/home/maxl/ssd_keras-master/ssd.py in SSD300(input_shape, num_classes)
135 net['pool6'] = GlobalAveragePooling2D(name='pool6')(net['conv8_2'])
136 # Prediction from conv4_3
--> 137 net['conv4_3_norm'] = Normalize(20, name='conv4_3_norm')(net['conv4_3'])
138 num_priors = 3
139 x = Convolution2D(num_priors * 4, 3, 3, border_mode='same',

/home/maxl/anaconda3/lib/python3.5/site-packages/keras/engine/topology.py in __call__(self, inputs, *kwargs)
617
618 # Actually call the layer, collecting output(s), mask(s), and shape(s).
--> 619 output = self.call(inputs, *
kwargs)
620 output_mask = self.compute_mask(inputs, previous_mask)
621

/home/maxl/ssd_keras-master/ssd_layers.py in call(self, x, mask)
45
46 def call(self, x, mask=None):
---> 47 output = K.l2_normalize(x, self.axis)
48 output *= self.gamma
49 return output

/home/maxl/anaconda3/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py in l2_normalize(x, axis)
3149 A tensor.
3150 """
-> 3151 return tf.nn.l2_normalize(x,axis=axis)
3152
3153

TypeError: l2_normalize() got an unexpected keyword argument 'axis'

Most helpful comment

Hi, in my case, you should change tf.nn.l2_normalize(x,axis=axis) to tf.nn.l2_normalize(x,dim=axis) in tensorflow_backend.py

All 3 comments

Hi, in my case, you should change tf.nn.l2_normalize(x,axis=axis) to tf.nn.l2_normalize(x,dim=axis) in tensorflow_backend.py

because tensorflow version.
I use tensorflow 1.6.0 in linux

so did you take it锛焎ause i
meet this problem too

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eric82714 picture eric82714  路  4Comments

fferroni picture fferroni  路  16Comments

MrXu picture MrXu  路  5Comments

lydials picture lydials  路  4Comments

ayushchopra96 picture ayushchopra96  路  15Comments