Facenet: TypeError: reduce_max() got an unexpected keyword argument 'keepdims'

Created on 25 Apr 2018  路  7Comments  路  Source: davidsandberg/facenet

python ~/face_paper/facenet-master/src/align/align_dataset_mtcnn.py \
~/face_paper/facenet-master/datasets/lfw/raw \
~/face_paper/facenet-master/datasets/lfw/lfw_mtcnnpy_160 \
--image_size 160 \
--margin 32 \
--random_order \
--gpu_memory_fraction 0.25 \

How to resolve this problem?

Most helpful comment

max_axis = tf.reduce_max(target, axis, keepdims=True)
should be modified by the next.
max_axis = tf.reduce_max(target, axis, keep_dims=True)

All 7 comments

max_axis = tf.reduce_max(target, axis, keepdims=True)
should be modified by the next.
max_axis = tf.reduce_max(target, axis, keep_dims=True)

I have checked a whole day,

That's why the older releases receive warnings about some words, including that word
Look

Instructions for updating:
keep_dims is deprecated, use keepdims instead

This warning comes in version 1.7
This was expected to be removed in recent releases from TensorFlow

Here are the owners of "facenet"
They have made this switch about 26 days ago to avoid such problems
see!
detect_face.py replace keep_dims (deprecated in TF) with keepdims 26 days ago
see file detect_face.py in repo ?
https://github.com/davidsandberg/facenet/tree/fc3b4c6702d353397c492a452663a20c29c2b562/src/align

thanks to them
>
in TensorFlow !
https://www.tensorflow.org/api_docs/python/tf/reduce_sum

Here's the conclusion that the TensorFlow library has a fairly old version
If you want to keep it, the switch you have made is correct
If we updated TensorFlow, there is no need to be sure to change any words

if TensorFlow > 1.7.0:
       keepdims
else:
       keep_dims

and other words check!
This is in case you do not want to update

>
But I advise you to update
I also advise myself ^


Note that I also use the older version 1.4
I have already changed the words to old ones
Thank you for your clarification

@mohammed-Emad
Thanks for your replay,and I didn't find the author's update.

you are welcome
But this is certain the author has already updated
I say again,
The update made the code incompatible with the version you have
The version of TensorFlow you already have is older than version 7.0
However, check TensorFlow recommendations for changed names for the latest version, or the version you have installed
Thanks
Update here
screenshot from 2018-04-26 16-59-20

@mohammed-Emad
Thanks!
Is your desktop environment KDE?

you are welcome @xlert
No it is lxde on ubuntu 14.lTS

Was this page helpful?
0 / 5 - 0 ratings