Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

模型训练的时候有问题 #2

Open
cdj0311 opened this issue Jul 21, 2016 · 2 comments
Open

模型训练的时候有问题 #2

cdj0311 opened this issue Jul 21, 2016 · 2 comments

Comments

@cdj0311
Copy link

cdj0311 commented Jul 21, 2016

在模型结构中出现问题:
model = Sequential()
model.add(Embedding(maxfeatures, 100,weights=init_weight))
model.add(Flatten())
model.add(Dense(700, 100))
model.add(Dropout(0.5))
model.add(Activation('relu'))
model.add(Dense(100, nb_classes))
model.add(Activation('softmax'))
model.compile(loss='categorical_crossentropy', optimizer='adam')

其中model.add(Flatten())有错:
Exception: The shape of the input to "Flatten" is not fully defined (got (None, 100). Make sure to pass a complete "input_shape" or "batch_input_shape" argument to the first layer in your model.

@emmapapa
Copy link

你这个问题有没有解决呢?我也出现了这个问题 TT

@bobeina
Copy link

bobeina commented Mar 4, 2017

看人家说是karas新版本调用方法变了,就算这里的解决了,后面的代码有些也要跟着改
——正在改的人留

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants