Function instantiation has undefined input shape at index: 116 in the outer inference context

Viewed 210

I use TFF 0.12.0

each client has in train 38 images and in test 16 images, I have 4 clients,

I write a simple code of federated learning :

.....

def create_compiled_keras_model():

    base_model = tf.keras.applications.resnet.ResNet50(include_top=False, weights='imagenet', input_shape=(224,224,3,))
    global_average_layer = tf.keras.layers.GlobalAveragePooling2D()
    prediction_layer = tf.keras.layers.Dense(2, activation='softmax')

    model = tf.keras.Sequential([
                               base_model,
                               global_average_layer,
                               prediction_layer
                               ])
    return model
    

def model_fn():
    
    keras_model = create_compiled_keras_model()
  
    return tff.learning.from_keras_model(keras_model, sample_batch, loss=tf.keras.losses.CategoricalCrossentropy(), metrics=[tf.keras.metrics.CategoricalAccuracy()]) 

iterative_process = tff.learning.build_federated_averaging_process(model_fn, server_optimizer_fn=lambda: tf.keras.optimizers.SGD(learning_rate=1.0), client_optimizer_fn=lambda: tf.keras.optimizers.SGD(learning_rate=0.001), client_weight_fn=None)

state = iterative_process.initialize()

I can't understand why I find those lines in execution:

2020-11-05 15:00:16.642666: W tensorflow/core/common_runtime/shape_refiner.cc:88] Function instantiation has undefined input shape at index: 32 in the outer inference context.
2020-11-05 15:00:16.642724: W tensorflow/core/common_runtime/shape_refiner.cc:88] Function instantiation has undefined input shape at index: 23 in the outer inference context.
2020-11-05 15:00:16.643344: W tensorflow/core/common_runtime/shape_refiner.cc:88] Function instantiation has undefined input shape at index: 51 in the outer inference context.
2020-11-05 15:00:16.643400: W tensorflow/core/common_runtime/shape_refiner.cc:88] Function instantiation has undefined input shape at index: 41 in the outer inference context.
2020-11-05 15:00:16.643545: W tensorflow/core/common_runtime/shape_refiner.cc:88] Function instantiation has undefined input shape at index: 69 in the outer inference context.
2020-11-05 15:00:16.643589: W tensorflow/core/common_runtime/shape_refiner.cc:88] Function instantiation has undefined input shape at index: 60 in the outer inference context.
2020-11-05 15:00:16.643696: W tensorflow/core/common_runtime/shape_refiner.cc:88] Function instantiation has undefined input shape at index: 97 in the outer inference context.
2020-11-05 15:00:16.643756: W tensorflow/core/common_runtime/shape_refiner.cc:88] Function instantiation has undefined input shape at index: 86 in the outer inference context.
2020-11-05 15:00:16.643923: W tensorflow/core/common_runtime/shape_refiner.cc:88] Function instantiation has undefined input shape at index: 106 in the outer inference context.
2020-11-05 15:00:16.643988: W tensorflow/core/common_runtime/shape_refiner.cc:88] Function instantiation has undefined input shape at index: 116 in the outer inference context.
2020-11-05 15:00:16.644071: W tensorflow/core/common_runtime/shape_refiner.cc:88] Function instantiation has undefined input shape at index: 79 in the outer inference context.
2020-11-05 15:00:16.644213: W tensorflow/core/common_runtime/shape_refiner.cc:88] Function instantiation has undefined input shape at index: 134 in the outer inference context.

Knowing that If I change Resnet50 with VGG16, those lines disappear. Help please !! what does this mean ?

0 Answers
Related