简体   繁体   中英

Unknown ? shape keras Deep learning

I'm trying to implement a deep learning model with Keras. Yet I have a problem with an unknown shape implementation. I was looking for a similar error but didn't find it.

Here is my code.

Xhome = dataset[:,32:62]

Xaway = dataset[:,62:92]

Ywin = dataset[:,2:32]

Yscorehome = dataset[:,0]

Yscoreaway = dataset[:,1]

home = Input(shape=(2431,30))

print(home)

Tensor("input_6:0", shape=(?, 2431, 30), dtype=float32)

图表

Ask me if you need more information to understand.

The unknown shape (? or None) is not an error - it means that this dimension is variable instead of fixed sized.

The first dimension in a Keras model is always the batch size and therefore gets the shape None . This allows you to use variable batch sizes. When you define your input shape in a Keras layer the batch size dimension is ignored and you only define the shape of each sample. In your case, the input shape (2431,30) means that each sample has this shape. If you want 2431 to be the batch size, you should instead use (30,) as input shape.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM