PySyft-TensorFlow icon indicating copy to clipboard operation
PySyft-TensorFlow copied to clipboard

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

Open yanndupis opened this issue 5 years ago • 7 comments

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.

yanndupis avatar Oct 22 '19 19:10 yanndupis

I can try and solve this :)

gmuraru avatar Oct 24 '19 15:10 gmuraru

Hey @murarugeorgec, did you make any progress? Otherwise, I can take up this issue.

arshjot avatar Nov 06 '19 11:11 arshjot

Hey guys, thanks for offering your help!

@arshjot - if @murarugeorgec is already working on it, happy to help you identify another issue. (@arshjot just let us know, I can assign you the issue).

If you guys have any questions, do not hesitate to reach out in OM Slack. Thanks!

yanndupis avatar Nov 06 '19 22:11 yanndupis

@arshjot I did not start looking into it. You can take it if you want

gmuraru avatar Nov 06 '19 22:11 gmuraru

Thanks @murarugeorgec! @arshjot the issue is assigned to you :) thanks

yanndupis avatar Nov 06 '19 23:11 yanndupis

Thank you guys! I've just submitted a PR to fix this :)

arshjot avatar Nov 07 '19 10:11 arshjot

Hey I would love to try to solve this

yasmineChelly-95 avatar Mar 31 '20 17:03 yasmineChelly-95