Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
maxlchina opened this issue Apr 12, 2018 · 3 comments
Open

Comments

@maxlchina
Copy link

maxlchina commented Apr 12, 2018

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'

@sudonto
Copy link

sudonto commented Apr 12, 2018

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

@chanilP
Copy link

chanilP commented Apr 24, 2018

because tensorflow version.
I use tensorflow 1.6.0 in linux

@Rorschaaaach
Copy link

so did you take it?cause i
meet this problem too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants