The tutorial has training and evaluation code, but not inference code, so I wrote an inference code at the end of the code to test individual inference.
res = model.predict(x_test[0]) # x_test[0].shape : (500, 1)
res.shape # is (500, 2)
I can only use single input for the predict() (not batch input), I guess due to make_model(input_shape=x_train.shape[1:])
what I don't understand is that the res.shape is (500, 2), not (2).
model.input_shape is (None, 500, 1) and model.output_shape is (None, 2)
I used (500, 1) shaped input, but why I got (500, 2) shaped output?
Could someone tell me what I did wrong here?
Thank you in advance.
Standalone code to reproduce the issue or tutorial link
https://keras.io/examples/timeseries/timeseries_classification_from_scratch/
res = model.predict(x_test[0]) # x_test[0].shape : (500, 1)
res.shape # is (500, 2)
Issue Type
Others
Source
source
Keras Version
3.0.5
Custom Code
Yes
OS Platform and Distribution
Ubuntu 22.04.1
Python version
3.10
GPU model and memory
No response
Current Behavior?
I am following the tutorial below.
The tutorial has training and evaluation code, but not inference code, so I wrote an inference code at the end of the code to test individual inference.
I can only use single input for the predict() (not batch input), I guess due to
make_model(input_shape=x_train.shape[1:])
what I don't understand is that the res.shape is (500, 2), not (2).model.input_shape is (None, 500, 1) and model.output_shape is (None, 2)
I used (500, 1) shaped input, but why I got (500, 2) shaped output? Could someone tell me what I did wrong here?
Thank you in advance.
Standalone code to reproduce the issue or tutorial link
Relevant log output
No response