Skip to content

Update Part 2 tutorial to include Dropout layer in Custom model example. #35

Description

@yanndupis

In Part 2 tutorial, for custom when including a Dropout layer in the custom model (tf.keras.models.Model subclassing), we were getting the following error when sending the model to a worker ( model gets saved with tf.keras.models.save_model during the process), we were getting the following error in #33 :

ValueError: Could not find matching function to call loaded from the SavedModel. Got:
  Positional arguments (2 total):
    * Tensor("inputs:0", shape=(None, 28, 28), dtype=float32)
    * Tensor("training:0", shape=(), dtype=bool)
  Keyword arguments: {}

Expected these arguments to match one of the following 4 option(s):

Option 1:
  Positional arguments (2 total):
    * TensorSpec(shape=(None, 28, 28), dtype=tf.float32, name='input_1')
    * False
  Keyword arguments: {}

Option 2:
  Positional arguments (2 total):
    * TensorSpec(shape=(None, 28, 28), dtype=tf.float32, name='input_1')
    * True
  Keyword arguments: {}

Option 3:
  Positional arguments (2 total):
    * TensorSpec(shape=(None, 28, 28), dtype=tf.float32, name='inputs')
    * False
  Keyword arguments: {}

Option 4:
  Positional arguments (2 total):
    * TensorSpec(shape=(None, 28, 28), dtype=tf.float32, name='inputs')
    * True
  Keyword arguments: {}

There was probably just a problem with the model definition. Would be great to have this custom model with a dropout layer working so it mirror perfectly the Sequential example.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Good first issue 🎓Perfect for beginners, welcome to OpenMined!

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions