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

Lab 1 part 2 getting Value error at defining Embedding Layer #162

Open
Bluehand1984 opened this issue May 24, 2024 · 2 comments
Open

Lab 1 part 2 getting Value error at defining Embedding Layer #162

Bluehand1984 opened this issue May 24, 2024 · 2 comments

Comments

@Bluehand1984
Copy link

Bluehand1984 commented May 24, 2024

I am getting valuerror on my Juypter Lab and Vscode. This only work on Coblab.
ValueError: Unrecognized keyword arguments passed to Embedding: {'batch_input_shape': [32, None]}

def build_model(vocab_size, embedding_dim, rnn_units, batch_size):
model = tf.keras.Sequential([
tf.keras.layers.Embedding(vocab_size, embedding_dim, batch_input_shape=[batch_size,None]),**
LSTM(rnn_units),
tf.keras.layers.Dense(vocab_size)**
])

return model

model = build_model(len(vocab), embedding_dim=256, rnn_units=1024, batch_size=32)

@jnchacon
Copy link

jnchacon commented Jun 2, 2024

Hi, I'm getting the same error, also in de solution...
Did you find the solution?

@jnchacon
Copy link

jnchacon commented Jun 2, 2024

Hi Again. I found that the error is because I had installed the 2.16.1 version (keras 3) of tensorflow, and the lab1 is for the 2.15.0 version (keras 2). I uninstalled the version I had and installed the 2.15.0 version instead. It worked.

pip3 install 'tensorflow==2.15.0' --force-reinstall

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

2 participants