Guest User

Untitled

a guest
Feb 19th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. ValueError: Error when checking target: expected embedding_1 to have shape (55, 50) but got array with shape (55, 16)
  2.  
  3. batch_size=16
  4. words = 20000
  5. units = 50
  6. tokens_per_sentence= 55
  7.  
  8. print (x.shape)
  9.  
  10. x_shape = x.shape
  11.  
  12. model = Sequential()
  13.  
  14. model.add(Embedding(words, units,input_length=tokens_per_sentence, batch_size=batch_size , input_shape=x_shape[1:]))
  15.  
  16. model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])
  17.  
  18. model.train_on_batch(x, y)
Add Comment
Please, Sign In to add comment