Facenet: Outputs of true_fn and false_fn must have the same type: float32, uint8

Created on 17 Dec 2019  路  9Comments  路  Source: davidsandberg/facenet

Hi Thanks for this awesome project I have a problem when I try to train the model I get this error

Traceback (most recent call last): File "src/train_softmax.py", line 582, in <module> main(parse_arguments(sys.argv[1:])) File "src/train_softmax.py", line 129, in main image_batch, label_batch = facenet.create_input_pipeline(input_queue, image_size, nrof_preprocess_threads, batch_size_placeholder) File "/Users/mohammadkhaleghi/AI/facenet/src/facenet.py", line 122, in create_input_pipeline lambda:tf.image.per_image_standardization(image)) File "/opt/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/util/deprecation.py", line 507, in new_func return func(*args, **kwargs) File "/opt/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/ops/control_flow_ops.py", line 1274, in cond "%s, %s" % (x.dtype.name, y.dtype.name)) ValueError: Outputs of true_fn and false_fn must have the same type: float32, uint8
any idea what can be problem?

Most helpful comment

This error means that your image is uint8 format,
So you neet to add
=python image = tf.to_float(image)
in "facenet/src/facenet.py:121".

All 9 comments

Hello, same issue here.

any solution ?

???

could someone give a solution to this?

pip install tensorflow-gpu==1.7 or 1.4 or 1.14

This error means that your image is uint8 format,
So you neet to add
=python image = tf.to_float(image)
in "facenet/src/facenet.py:121".

pip install tensorflow-gpu==1.7

cannot run it with the error: ERROR: Could not find a version that satisfies the requirement tensorflow-gpu==1.7 (from versions: none)

same error here. I could not install tensorflow==1.7 or tensorflow-gpu==1.7. Error: Could not find a version that satisfies the requirement

I managed to fix it by downgrading these:

  1. pip install tensorflow==1.13.0rc1
  2. pip install scipy==1.1.0 (optional)
  3. pip install numpy==1.16.1 (optional)
Was this page helpful?
0 / 5 - 0 ratings