If you look at Part 2 tutorial, for custom models (tf.keras.models.Model), before sending the model to the worker, we need to run model.predict(dummy_data) to set the input_shape ( required by tf.keras.models.save_model).
Ideally we would like to remove this step or just have to call model(dummy_data) before sending the model. You can find more information in this conversation.