ValueError: Dimension 0 in both shapes must be equal, but are 0 and 512

Hi, I try to run a Probabilistic face embeddings model. It works well when I run my function with tensorflow 2.1 or tensorflow 1.x but when I tried to run it with tensorflow 2.2 and more I have this error : ValueError: Node ‘gradients/UncertaintyModule/fc_log_sigma_sq/BatchNorm/cond/FusedBatchNorm_1_grad/FusedBatchNormGrad’ has an _output_shapes attribute inconsistent with the GraphDef for output [#3]: Dimension 0 in both shapes must be equal, but are 0 and 512. Shapes are [0] and [512]
It happens when the pretrained model I have is loading when it does saver = tf.compat.v1.train.import_meta_graph(meta_file, clear_devices=True, import_scope=scope) to import the meta file of the PFE_sphere64_msarcface_am model

To reproduce the error : download the folder Probabilistic-Face-Embeddings_new : Probabilistic-Face-Embeddings_new - Google Drive and run eval_lfw with parameters --model_dir pretrained/PFE_sphere64_msarcface_am --dataset_path data/Dataset --protocol_path ./proto/pairs_dataset.txt

Thank you for your help!

1 Like

Have you checked:

TensorFlow version compatibility  |  TensorFlow Core

Yes, I used import tensorflow.compat.v1 as tf tf.disable_v2_behavior() but it didn’t change anything

Is it solved i am facing the same issue now