Skip to content

Instantly share code, notes, and snippets.

@ChunML
Created March 13, 2019 13:20
Show Gist options
  • Save ChunML/0204d6adcd39ac583b7247342743f926 to your computer and use it in GitHub Desktop.
Save ChunML/0204d6adcd39ac583b7247342743f926 to your computer and use it in GitHub Desktop.
for e in range(10):
accuracy = []
for batch, (text, label) in enumerate(train_data.take(-1)):
with tf.GradientTape() as tape:
logits = model(text)
label = tf.expand_dims(label, 1)
loss = loss_func(label, logits)
@AmritaAmmo
Copy link

ValueError Traceback (most recent call last)
in
3 for batch, (text, label) in enumerate(train_data.take(-1)):
4 with tf.GradientTape() as tape:
----> 5 logits = model(text)
6 label = tf.expand_dims(label, 1)
7 loss = loss_func(label, logits)
ValueError: Input 0 of layer bidirectional_1 is incompatible with the layer: expected ndim=3, found ndim=5. Full shape received: [1, 1, 1, 164, 64]
I have this error while running the code.Please Rectify..!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment