keras-team/keras-io

How to make individual predictions using the FNet example?

Closed this issue · 4 comments

Issue Type

Support

Source

source

Keras Version

Keras 2.14

Custom Code

Yes

OS Platform and Distribution

Linux Ubuntu

Python version

No response

GPU model and memory

No response

Current Behavior?

Once I have used the script for the creation of an FNet network, I want to make predictions on individual entries, however, doing it this way generates an array with several values and there should only be 2. How to make individual predictions using the predict method?

reference: https://keras.io/examples/nlp/fnet_classification_with_keras_nlp/

Standalone code to reproduce the issue or tutorial link

When I use predict, I got a vector with shape (32, 3)

fnet_classifier.predict(({"input_ids": [tokenizer("Hi, I'm Erick")]}))

Relevant log output

No response

Using the same example when I predicted I got the shape 16,1

fnet_classifier.predict(({"input_ids": [tokenizer("Hi, I'm Erick")]})).shape
16/16 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step
(16, 1)

This issue is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you.

This issue was closed because it has been inactive for 28 days. Please reopen if you'd like to work on this further.

Are you satisfied with the resolution of your issue?
Yes
No