ValueError when calling model.predict_step

58 views
Skip to first unread message

cam

unread,
Feb 10, 2023, 2:22:01 PM2/10/23
to User Group | Simple ML for Sheets (Public)
When using the "sharing model" feature, the tool produces code to copy and execute in a new Google Colab notebook. Here is the snippet to predict a step

# Make predictions with the model
examples = {
  "value" : ["<OOD>, second, fourth, third, fifth, first", "<OOD>, third, fifth, first, fourth, second, sixth."],
}
model.predict_step(examples)


This code does not work out of the box and generates the following error:
ValueError: Exception encountered when calling layer 'inference_core_model_4' (type InferenceCoreModel).

Could not find matching concrete function to call loaded from the SavedModel. Got:
  Positional arguments (2 total):
    * {'value': ['<OOD>, second, fourth, third, fifth, first',
           '<OOD>, third, fifth, first, fourth, second, sixth.']}
    * False
  Keyword arguments: {}

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

Option 1:
  Positional arguments (2 total):
    * {'value': RaggedTensorSpec(TensorShape([None, None]), tf.string, 1, tf.int64)}
    * False
  Keyword arguments: {}

Option 2:
  Positional arguments (2 total):
    * {'value': RaggedTensorSpec(TensorShape([None, None]), tf.string, 1, tf.int64)}
    * True
  Keyword arguments: {}

Call arguments received by layer 'inference_core_model_4' (type InferenceCoreModel):
  • args=({'value': ["'<OOD>, second, fourth, third, fifth, first'", "'<OOD>, third, fifth, first, fourth, second, sixth.'"]},)
  • kwargs={'training': 'False'}


Can the example code produced by the SimpleML tool be modified to something that works without modification?

How can I modify the examples variable so the call succeeds? 

Carlos Sutrun

unread,
Feb 10, 2023, 2:31:29 PM2/10/23
to cam, User Group | Simple ML for Sheets (Public)
+1, I have got the same error. 

--
You received this message because you are subscribed to the Google Groups "User Group | Simple ML for Sheets (Public)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simple-ml-for-sheet...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simple-ml-for-sheets-users/46375169-7aca-4151-8c74-ff72f5256169n%40googlegroups.com.

Luiz Gustavo Martins

unread,
Feb 14, 2023, 10:51:07 AM2/14/23
to Carlos Sutrun, cam, User Group | Simple ML for Sheets (Public)
Hi,

We are looking into that issue and we will get back to you as soon as we have a fix.
sorry

   Gus

Reply all
Reply to author
Forward
0 new messages