I tried the code in pycharm got this error

Found unexpected instance while processing input tensors for keras functional model. Expecting KerasTensor which is from tf.keras.Input() or output from keras layer call(). Got: 64

Maybe you are using a numpy list or just python list instead of tf tensor!